Skip to content

Read-only accessor functions #3192

@hreinecke

Description

@hreinecke

Hey,
while checking the accessor functions (and the auto-generator; great job btw !) I've found that accessors will always be symmetric, ie having a 'getter' and a 'setter' function. Which is nice for settings which can be modified at will, but for most settings in eg nvme_ctrl this is not really true; the structure is prepared (during which time the accessor functions work), but then the actual controller is created via nvme_add_ctrl(). And once created (by the kernel) most of the settings are read-only (transport, traddr etc are all immutable).

This raises several asks:

  • Can we have a 'readonly' marker in the structure to indicate that only a 'getter' function should be generated?
  • Can we separate the options required to create a controller from the options of that controller?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions