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?
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: