Received: from eggs.gnu.org ([2001:4830:134:3::10]:46164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD9l2-0002pD-PY for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WD9kt-0000Rl-LC for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:36:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD9kt-0000RO-Db for qemu-devel@nongnu.org; Tue, 11 Feb 2014 04:35:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1B9ZnDH011333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Feb 2014 04:35:49 -0500 Date: Tue, 11 Feb 2014 17:35:56 +0800 From: Fam Zheng Message-ID: <20140211093556.GF12675@T430.nay.redhat.com> References: <1390994251-21768-1-git-send-email-stefanha@redhat.com> <20140211013907.GB2923@T430.nay.redhat.com> <20140211084119.GA3102@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140211084119.GA3102@dhcp-200-207.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH] QMP: allow JSON dict arguments in qmp-shell List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Luiz Capitulino 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 > > > --- > > > > 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