qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] QMP: allow JSON dict arguments in qmp-shell
Date: Tue, 11 Feb 2014 09:41:19 +0100	[thread overview]
Message-ID: <20140211084119.GA3102@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <20140211013907.GB2923@T430.nay.redhat.com>

Am 11.02.2014 um 02:39 hat Fam Zheng geschrieben:
> On Wed, 01/29 12:17, Stefan Hajnoczi wrote:
> > qmp-shell hides the QMP wire protocol JSON encoding from the user.  Most
> > of the time this is helpful and makes the command-line human-friendly.
> > 
> > Some QMP commands take a dict as an argument.  In order to express this
> > we need to revert back to JSON notation.
> > 
> > This patch allows JSON dict arguments in qmp-shell so commands like
> > blockdev-add and nbd-server-start can be invoked:
> > 
> >   (QEMU) blockdev-add options={"driver":"file","id":"drive1",...}
> > 
> > Note that spaces are not allowed since str.split() is used to break up
> > the command-line arguments first.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> 
> While this is definitely useful, just wondering if it is more friendly to allow
> passing options as command line options do:
> 
>     (QEMU) blockdev-add options.driver=file options.id=drive1

In fact, I have been considering the brace syntax even for the command
line, because the dot syntax gets a bit too verbose when you have a lot
of nested dicts. The reason why I didn't do it is that it would
introduce more special characters.

>From a usability POV, it might be best to have both.

Kevin

  reply	other threads:[~2014-02-11  8:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 11:17 [Qemu-devel] [PATCH] QMP: allow JSON dict arguments in qmp-shell Stefan Hajnoczi
2014-01-29 15:48 ` Eric Blake
2014-01-29 15:50 ` Benoît Canet
2014-02-10 20:43 ` Luiz Capitulino
2014-02-11  1:39 ` Fam Zheng
2014-02-11  8:41   ` Kevin Wolf [this message]
2014-02-11  9:35     ` Fam Zheng
2014-02-11  8:43   ` Markus Armbruster
2014-02-11  9:38     ` Fam Zheng
2014-02-11 10:45 ` [Qemu-devel] [PATCH] QMP: allow dot separated dict path " Fam Zheng
2014-02-11 13:28   ` Stefan Hajnoczi
2014-02-12  0:56     ` Fam Zheng

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=20140211084119.GA3102@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=famz@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).