[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-leng
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list |
Date: |
Thu, 29 Mar 2012 15:42:34 -0300 |
On Thu, 29 Mar 2012 13:26:34 -0500
Anthony Liguori <address@hidden> wrote:
> On 03/29/2012 12:26 PM, Luiz Capitulino wrote:
> > This allows for QAPI functions to receive a variable-length argument
> > list. This is going to be used by device_add and netdev_add commands.
> >
> > In the schema, the argument list is represented by type name '**',
> > like this example:
> >
> > { 'command': 'foo', 'data': { 'arg-list': '**' } }
> >
> > Each argument is represented by the KeyValues type and the C
> > implementation should expect a KeyValuesList, like:
> >
> > void qmp_foo(KeyValuesList *values_list, Error **errp);
> >
> > XXX: This implementation is simple but very hacky. We just iterate
> > through all arguments and build the KeyValuesList list to be
> > passed to the QAPI function.
> >
> > Maybe we could have a kwargs type, that does exactly this but
> > through a visitor instead?
> >
> > Signed-off-by: Luiz Capitulino<address@hidden>
>
> What about just treating '**' as "marshal remaining arguments to a string"
> and
> then pass that string to device_add? qmp_device_add can then parse that
> string
> with QemuOpts.
If this turns out to be simple enough, I'm fine with it.
> It's a bit ugly, but that's how things worked. When we introduce qom_add,
> this
> problem goes away because you would make multiple calls to qom_set to set all
> of
> the properties.
Just out of curiosity, is qom_add going to supersede device_add?
- [Qemu-devel] [PATCH 01/13] qemu-option: qemu_opts_create(): use error_set(), (continued)
- [Qemu-devel] [PATCH 01/13] qemu-option: qemu_opts_create(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 02/13] qemu-option: parse_option_number(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 07/13] qemu-option: opts_do_parse(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 04/13] qemu-option: parse_option_size(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 09/13] qerror: introduce QERR_INVALID_OPTION_GROUP, Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 06/13] qemu-option: opt_set(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 03/13] qemu-option: parse_option_bool(): use error_set(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 08/13] qemu-option: introduce qemu_opt_set_err(), Luiz Capitulino, 2012/03/29
- [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Luiz Capitulino, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Anthony Liguori, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Michael Roth, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Anthony Liguori, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Michael Roth, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Michael Roth, 2012/03/29
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Paolo Bonzini, 2012/03/30
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Luiz Capitulino, 2012/03/30
- Re: [Qemu-devel] [PATCH 12/13] qapi: support for keyworded variable-length argument list, Paolo Bonzini, 2012/03/29
[Qemu-devel] [PATCH 13/13] qapi: convert device_add, Luiz Capitulino, 2012/03/29
[Qemu-devel] [PATCH 05/13] qemu-option: qemu_opt_parse(): use error_set(), Luiz Capitulino, 2012/03/29