On Tue, 02/11 09:43, Markus Armbruster wrote: > Fam Zheng <f...@redhat.com> writes: > > > 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 <stefa...@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 > > Yeah. The "spaces are not allowed" syntax is pretty horrid :)
It's not hard to loose the space restriction by making qmp-shell smarter to match "}" with "{", but the quote marks and colons are still troublesome. Maybe I'll think differently when many levels of nesting becomes common. :) Fam