Re: [PATCH v3 27/30] hmp: QAPIfy object_add

2021-03-13 Thread Paolo Bonzini
On 13/03/21 14:28, Markus Armbruster wrote: Kevin Wolf writes: This switches the HMP command object_add from a QemuOpts-based parser to user_creatable_add_from_str() which uses a keyval parser and enforces the QAPI schema. Apart from being a cleanup, this makes non-scalar properties and help

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-13 Thread Markus Armbruster
Markus Armbruster writes: > Paolo Bonzini writes: > >> On 11/03/21 15:08, Markus Armbruster wrote: I would rather keep the OptsVisitor here. Do the same check for JSON syntax that you have in qobject_input_visitor_new_str, and whenever you need to walk all -object arguments, use

Re: [PATCH v3 27/30] hmp: QAPIfy object_add

2021-03-13 Thread Markus Armbruster
Kevin Wolf writes: > This switches the HMP command object_add from a QemuOpts-based parser to > user_creatable_add_from_str() which uses a keyval parser and enforces > the QAPI schema. > > Apart from being a cleanup, this makes non-scalar properties and help > accessible. In order for help to be

Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object

2021-03-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 13/03/21 08:40, Markus Armbruster wrote: >>> +if (!user_creatable_add_from_str(optarg, _err)) { >>> +if (local_err) { >>> +error_report_err(local_err); >>> +exit(2); >>> +

Re: [PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline()

2021-03-13 Thread Paolo Bonzini
On 13/03/21 09:41, Markus Armbruster wrote: Observation, not objection: 1. QMP core parses JSON text into QObject, passes to generated marshaller. 2. Marshaller converts QObject to ObjectOptions with the QObject input visitor, passes to qmp_object_add(). 3. qmp_object_add() wraps

Re: [PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline()

2021-03-13 Thread Markus Armbruster
Kevin Wolf writes: > The implementation for --object can be shared between > qemu-storage-daemon and other binaries, so move it into a function in > qom/object_interfaces.c that is accessible from everywhere. > > This also requires moving the implementation of qmp_object_add() into a > new