From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51663 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOWRp-0007Bc-W4 for qemu-devel@nongnu.org; Tue, 15 Jun 2010 09:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOWRb-0000s3-50 for qemu-devel@nongnu.org; Tue, 15 Jun 2010 09:44:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51694) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOWRa-0000rr-UT for qemu-devel@nongnu.org; Tue, 15 Jun 2010 09:44:47 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5FDik9q031098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jun 2010 09:44:46 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5FDijn8012150 for ; Tue, 15 Jun 2010 09:44:45 -0400 Message-ID: <4C1783CC.7070307@redhat.com> Date: Tue, 15 Jun 2010 16:44:44 +0300 From: Avi Kivity MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: RFC v2: blockdev_add & friends, brief rationale, QMP docs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Christoph Hellwig , qemu-devel@nongnu.org, Luiz Capitulino , Gerd Hoffmann On 06/10/2010 08:45 PM, Markus Armbruster wrote: > > > * Our config file format is in INI syntax. QemuOpts correspond to > INI sections. Sections can't be nested, so recursive QemuOpts > don't translate. > git (and probably others) use [a "b"] c = d for a.b.c=d > Examples: > > * Single protocol: > > -blockdev id=blk1,format=raw,protocol=[file,file=fedora.img] > > Requires suitable syntactic sugar to get the simple form (*). > > * blkdebug > > -blockdev id=blk2,format=qcow2,\ > protocol=[blkdebug,config=test.blkdebug,\ > protocol=[file,file=test.qcow2]] > > * Avi's mirror: > > -blockdev id=blk3,format=raw,\ > protocol=[mirror,\ > [file,file=local.img],\ > [nbd,domain=unix,sockert=nbd-sock]] > > 2. We already have a syntax to specify trees, namely JSON, so use it > > If -blockdev's argument starts with '{', it's a JSON object suitable > as argument of blockdev_add in QMP. > > We still provide ordinary QemuOpts syntax for the cases that can be > expressed with it, i.e. single protocol. > > I figure we'd want syntactic sugar for blkdebug, to permit its use > from the command line without having to resort to JSON. > Might be nice as a general extension to QemuOpts. > 3. Stack protocols through named references > > The first protocol is "inlined" into -blockdev. Any further > protocols need to be referenced by name. > > Best explained by example: > > * Single protocol: > > -blockdev id=blk1,format=raw,protocol=file,file=fedora.img > > To get the simple form (*), make protocol optional with a suitable > default. > > * blkdebug > > -blockdev id=blk2,format=qcow2,protocol=blkdebug,config=test.blkdebug,\ > base=blk2-base > -blockproto id=blk2-base,protocol=file,file=test.qcow2 > > * Avi's mirror: > > -blockdev id=blk3,format=raw,protocol=mirror,\ > base=blk3-base1,base=blk3=base2 > -blockproto id=blk3-base1,protocol=file,file=local.img > -blockproto id=blk3-base2,protocol=nbd,domain=unix,sockert=nbd-sock > > Anything but a single protocol becomes pretty verbose. Syntactic > sugar for the blkdebug case would be possible; not sure it's worth > it. > > No QemuOpts syntax changes. INI can handle this just fine. > > Looks like the least painful option as no new infrastructure is needed. I'd go with this. -- error compiling committee.c: too many arguments to function