qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: el13635@mail.ntua.gr, kwolf@redhat.com, berrange@redhat.com,
	pbonzini@redhat.com
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	[thread overview]
Message-ID: <7ce274ba-e487-4f16-4620-8c68a3ace35d@redhat.com> (raw)
In-Reply-To: <1502367921-17730-3-git-send-email-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]

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 <armbru@redhat.com>
> ---
>  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 <eblake@redhat.com>

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2017-08-10 14:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 12:25 [Qemu-devel] [PATCH 0/2] vl: Partial support for non-scalar properties with -object Markus Armbruster
2017-08-10 12:25 ` [Qemu-devel] [PATCH 1/2] vl: Factor object_create() out of main() Markus Armbruster
2017-08-10 14:43   ` Eric Blake
2017-08-10 16:28     ` Markus Armbruster
2017-08-11  3:33       ` Philippe Mathieu-Daudé
2017-08-10 12:25 ` [Qemu-devel] [PATCH 2/2] vl: Partial support for non-scalar properties with -object Markus Armbruster
2017-08-10 14:59   ` Eric Blake [this message]
2017-08-10 16:33     ` Markus Armbruster
2017-08-10 15:02   ` Paolo Bonzini
2017-08-10 16:36     ` Markus Armbruster
2017-08-10 16:38       ` Paolo Bonzini
2017-08-11  6:20         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ce274ba-e487-4f16-4620-8c68a3ace35d@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=el13635@mail.ntua.gr \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).