qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] QMP: allow JSON dict arguments in qmp-shell


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH] QMP: allow JSON dict arguments in qmp-shell
Date: Tue, 11 Feb 2014 17:35:56 +0800
User-agent: Mutt/1.5.22 (2013-10-16)

On Tue, 02/11 09:41, Kevin Wolf wrote:
> 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 <address@hidden>
> > > ---
> > 
> > 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.

Typing json syntax is harder than repeating the dict paths, so personally I
still prefer dot syntax over braces, colons and double quotes.

Fam



reply via email to

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