Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-24 Thread Markus Armbruster
Anthony Liguori writes: > On 03/22/2011 08:01 AM, Markus Armbruster wrote: >> Type checking macros are feasible (see [*] for an existence proof), but >> things do get hairy, and the resulting error messages can be less than >> clear at times. > > That just gives you a warning. You can do much be

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-22 Thread Anthony Liguori
On 03/22/2011 08:01 AM, Markus Armbruster wrote: Type checking macros are feasible (see [*] for an existence proof), but things do get hairy, and the resulting error messages can be less than clear at times. That just gives you a warning. You can do much better things with __builtin_types_com

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-22 Thread Markus Armbruster
Anthony Liguori writes: > On 03/18/2011 09:04 AM, Markus Armbruster wrote: > Initial code is in my QAPI tree. > > I'm not going to start converting things until we get closer to the > end of 0.15 and QAPI is fully merged. My plan is to focus on this for > 0.16 and do a full c

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-18 Thread Anthony Liguori
On 03/18/2011 09:04 AM, Markus Armbruster wrote: Initial code is in my QAPI tree. I'm not going to start converting things until we get closer to the end of 0.15 and QAPI is fully merged. My plan is to focus on this for 0.16 and do a full conversion for the 0.16 time frame using the same approa

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-18 Thread Stefan Hajnoczi
On Tue, Mar 15, 2011 at 1:27 PM, Anthony Liguori wrote: > # create a blockdev using probing without relying on implicit keys and > allowing unsafe probing > -blockdev > format.probe.unsafe=on,format.probe.protocol.file.filename=my-image.qcow2,id=ide0-hd0 This is a programmer's user interface :).

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-18 Thread Markus Armbruster
Anthony Liguori writes: > On 03/17/2011 10:22 AM, Markus Armbruster wrote: >> >>> void qcfg_handle_vnc(VncConfig *option, Error **errp) >>> { >>> } >>> >>> And that's it. You can squirrel away the option such that they all >>> can be processed later, you can perform additional validation and >>>

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-18 Thread Kevin Wolf
Am 17.03.2011 19:28, schrieb Anthony Liguori: > On 03/17/2011 10:22 AM, Markus Armbruster wrote: >>> I wanted to share these plans early hoping to get some feedback and >>> also to maybe interest some folks in helping out. >> There's also QEMUOptionParameter, thankfully limited to block code. Any

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-17 Thread Anthony Liguori
On 03/17/2011 10:22 AM, Markus Armbruster wrote: void qcfg_handle_vnc(VncConfig *option, Error **errp) { } And that's it. You can squirrel away the option such that they all can be processed later, you can perform additional validation and return an error, or you can implement the appropriate

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-17 Thread Markus Armbruster
Anthony Liguori writes: > As I've been waiting for QAPI review, I've been working on the design > of a new mechanism to replace our current command line option handling > (QemuOpts) with something that reuses the QAPI infrastructure. I'm ignoring the connection to QAPI, because I'm still ignoran

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-15 Thread Anthony Liguori
On 03/15/2011 08:45 AM, Kevin Wolf wrote: 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 alr

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-15 Thread Kevin Wolf
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 (b

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-15 Thread 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

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-15 Thread Kevin Wolf
Am 14.03.2011 18:48, schrieb Anthony Liguori: > As I've been waiting for QAPI review, I've been working on the design of > a new mechanism to replace our current command line option handling > (QemuOpts) with something that reuses the QAPI infrastructure. > > The 'QemuOpts' syntax is just a way

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-14 Thread Anthony Liguori
On 03/14/2011 02:52 PM, Lluís wrote: Anthony Liguori writes: I've got a spec written up at http://wiki.qemu.org/Features/QCFG. Initial code is in my QAPI tree. What about moving the documentation to a 'doc' attribute? Thus, instead of the example vnconfig: { 'type': 'VncConfig', 'doc': '

Re: [Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-14 Thread Lluís
Anthony Liguori writes: > I've got a spec written up at http://wiki.qemu.org/Features/QCFG. Initial > code > is in my QAPI tree. What about moving the documentation to a 'doc' attribute? Thus, instead of the example vnconfig: { 'type': 'VncConfig', 'doc': 'Configuration options for the buil

[Qemu-devel] [RFC] QCFG: a new mechanism to replace QemuOpts and option handling

2011-03-14 Thread Anthony Liguori
As I've been waiting for QAPI review, I've been working on the design of a new mechanism to replace our current command line option handling (QemuOpts) with something that reuses the QAPI infrastructure. The 'QemuOpts' syntax is just a way to encode complex data structures. 'nic,model=virtio,