Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-07-16 Thread Luiz Capitulino
On Sat, 14 Jul 2012 00:48:58 +0200 Laszlo Ersek wrote: > On 07/13/12 18:51, Luiz Capitulino wrote: > > On Wed, 13 Jun 2012 10:22:36 +0200 > > Laszlo Ersek wrote: > > >> Repeating an optarg is supported; > > > > I see that the current code supports this too, but why? Something > > like this shou

Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-07-13 Thread Laszlo Ersek
On 07/14/12 00:48, Laszlo Ersek wrote: > You're right. opts_do_parse() makes an exception with "id" and doesn't > call opt_set() for any occurrence of it. Would you accept the attached > fix, split up and squashed into previous parts appropriately? Sigh. I haven't looked at this code in a month,

Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-07-13 Thread Laszlo Ersek
On 07/13/12 18:51, Luiz Capitulino wrote: > On Wed, 13 Jun 2012 10:22:36 +0200 > Laszlo Ersek wrote: >> Repeating an optarg is supported; > > I see that the current code supports this too, but why? Something > like this should fail: > > -netdev type=tap,vhost=on,vhost=off,id=guest1,script=qemu-i

Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-07-13 Thread Luiz Capitulino
On Wed, 13 Jun 2012 10:22:36 +0200 Laszlo Ersek wrote: > This visitor supports parsing > > -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...] > > style QemuOpts objects into "native" C structures. After defining the type > tree in the qapi schema (see below), a root type travers

Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-06-13 Thread Laszlo Ersek
On 06/13/12 12:50, Paolo Bonzini wrote: > Il 13/06/2012 10:22, Laszlo Ersek ha scritto: >> +static void >> +opts_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) >> +{ >> +OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v); >> +const QemuOpt *opt; >> +const char

Re: [Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-06-13 Thread Paolo Bonzini
Il 13/06/2012 10:22, Laszlo Ersek ha scritto: > +static void > +opts_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) > +{ > +OptsVisitor *ov = DO_UPCAST(OptsVisitor, visitor, v); > +const QemuOpt *opt; > +const char *str; > + > +opt = lookup_scalar(ov, name, e

[Qemu-devel] [PATCH v2 05/17] qapi: introduce OptsVisitor

2012-06-13 Thread Laszlo Ersek
This visitor supports parsing -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...] style QemuOpts objects into "native" C structures. After defining the type tree in the qapi schema (see below), a root type traversal with this visitor linked to the underlying QemuOpts object will bu