On 11/3/21 18:29, Kevin Wolf wrote:
This series adds QOM class definitions to the QAPI schema, introduces
a new TypeInfo.instance_config() callback that configures the object at
creation time (instead of setting properties individually) and is
separate from runtime property setters (which often used to be not
really tested for runtime use), and finally generates a marshalling
function for .instance_config() from the QAPI schema that makes this a
natural C interface rather than a visitor based one.
That's pretty cool!
Just one question: why not always use boxed configuration? It should
not make the instance_config types any larger, and it avoids unwieldy
argument lists.
Also, for the obligatory bikeshedding remark, do you have any other
plans or ideas for the colon-separated auto generated typenames? Having
both the "namespace" (qom) and the more specific use (config) before the
classname is a bit weird, compared to the existing structs like
RngRandomProperties. Especially if boxed config is more used (or
becomes the only possibility), it might be that qom:class-name:config,
or even just class-name:config, make for nicer code in the object
implementation.
Paolo