On Fri, Mar 06, 2026 at 10:14:23AM +0100, Markus Armbruster wrote:
> Igor Mammedov <[email protected]> writes:
> 
> > I might be totally wrong, but occasionally I've considered using
> > object_set_properties_from_qdict() internally as much more compact form
> > compared to 'object_new()/set_this_property and set that one too' noodle.
> 
> Clear signal our C interface to QOM object configuration is lacking.
> 
> Going through a QDict is disgusting, though.  There has to be a more
> direct way.  One that doesn't involve building temporary trees just so
> we can use existing visitors.
> 
> What if we could pass the entire configuration as a struct?  Instead of
> setting properties one by one, pass a struct literal and be done.

Or we pass things as typed variadic args.

  object_new_args(TYPE_NAME,
                  "foo": someval,
                  "bar: otherval,
                  NULL);

we know the QAPI type for each named property, so we know how to
interpret type-correct values for each property in the var-args.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|

Reply via email to