From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36700 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzUXO-0000Ah-1h for qemu-devel@nongnu.org; Tue, 15 Mar 2011 09:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzUXM-0004U3-Mx for qemu-devel@nongnu.org; Tue, 15 Mar 2011 09:43:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzUXM-0004Tf-AH for qemu-devel@nongnu.org; Tue, 15 Mar 2011 09:43:48 -0400 Message-ID: <4D7F6D91.60605@redhat.com> Date: Tue, 15 Mar 2011 14:45:53 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling References: <4D7E5507.8010205@codemonkey.ws> <4D7F3AC2.1040309@redhat.com> <4D7F6936.3050607@codemonkey.ws> In-Reply-To: <4D7F6936.3050607@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Chris Wright , qemu-devel , Markus Armbruster , Stefan Hajnoczi , Adam Litke Am 15.03.2011 14:27, schrieb Anthony Liguori: > On 03/15/2011 05:09 AM, Kevin Wolf wrote: >>> 5) Very complex data types can be implemented. We had some discussion >>> of supporting nested structures with -blockdev. This wouldn't work with >>> QemuOpts but I've already implemented it with QCFG (blockdev syntax is >>> my test case right now). The syntax I'm currently using is -blockdev >>> cache=none,id=foo,format.qcow.protocol.nbd.hostname=localhost where '.' >>> is used to reference sub structures. >> Do you have an example from your implementation for this? > > It's not exhaustive as I'm only using this for testing but here's what > I've been working with: > > { 'type': 'ProbeProtocol', 'data': { 'unsafe': 'bool', 'filename': 'str' } } > > { 'type': 'FileProtocol', 'data': { 'filename': 'str' } } > > { 'type': 'HostDeviceProtocol', 'data': { 'device': 'str' } } > > { 'type': 'NbdProtocol', 'data': { 'hostname': 'str', 'port': 'int' } } > > { 'union': 'BlockdevProtocol', > 'data': { 'probe': 'ProbeProtocol', 'file': 'FileProtocol', > 'host-dev': 'HostDeviceProtocol', 'nbd': 'NbdProtocol' } } What would this look like in the generated C code? A union of differently typed pointers? Are format drivers still contained in a single C file in block/ that is enabled just by compiling it in or does the block layer now have to know about all available drivers and the options they provide? >> This is probably the most complex thing you can get, so I think it would >> make a better example than a VNC configuration. > > Yup, that's been what I've been using to prototype all of this. I > didn't it in the mail because it's rather complex :-) This is exactly what makes it interesting. :-) Kevin