qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properti


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properties with -object
Date: Thu, 10 Aug 2017 09:59:31 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 08/10/2017 07:25 AM, Markus Armbruster wrote:
> We've wanted -object to support non-scalar properties for a while.
> Dan Berrange tried in "[PATCH v4 00/10]Provide a QOM-based
> authorization API".  Review led to the conclusion that we need to
> replace rather than add to QemuOpts.  Initial work towards that goal
> has been merged to provide -blockdev (commit 8746709), but there's
> substantial work left, mostly due to an bewildering array of
> compatibility problems.
> 
> Even if a full solution is still out of reach, we can have a partial
> solution now: accept -object argument in JSON syntax.  This should
> unblock development work that needs non-scalar properties with -object
> 

Trailing dot?

> The implementation is similar to -blockdev, except we use the new
> infrastructure only for the new JSON case, and stick to QemuOpts for
> the existing KEY=VALUE,... case, to sidestep compatibility problems.
> 
> If we did this for more options, we'd have to factor out common code.
> But for one option, this will do.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  qapi-schema.json | 14 +++++++++++---
>  vl.c             | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 66 insertions(+), 3 deletions(-)
> 

2.11 material.

> @@ -4078,6 +4102,29 @@ int main(int argc, char **argv, char **envp)
>  #endif
>                  break;
>              case QEMU_OPTION_object:
> +                /*
> +                 * TODO Use qobject_input_visitor_new_str() instead of
> +                 * QemuOpts, not in addition to.  Not done now because
> +                 * keyval_parse() isn't wart-compatible with QemuOpts.
> +                 */
> +                if (optarg[0] == '{') {

So we DON'T allow " {...}", even though that is valid JSON.  I'm okay
with stating that { is magic only as the first byte.

Reviewed-by: Eric Blake <address@hidden>

Do we need any documentation additions (whether in --help output, or in
the man page, or ?)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]