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
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
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
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);
>>> +
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
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