[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generat
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels |
Date: |
Thu, 14 Jul 2016 16:17:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> The next patch will add support for passing a qapi union type
> as the 'data' of a command. But to do that, the user function
> for implementing the command, as called by the generated
> marshal command, must take the corresponding C struct as a
> single boxed pointer, rather than a breakdown into one
> parameter per member. Even without a union, being able to use
> a C struct rather than a list of parameters can make it much
> easier to handle coding with QAPI.
>
> This patch adds the internal plumbing of a 'boxed' flag
> associated with each command and event. In several cases,
> this means adding indentation, with one new dead branch and
> the remaining branch being the original code more deeply
> nested; this was done so that the new implementation in the
> next patch is easier to review without also being mixed with
> indentation changes.
>
> For this patch, no behavior or generated output changes, other
> than the testsuite outputting the value of the new flag
> (always False for now).
>
> Signed-off-by: Eric Blake <address@hidden>
>
> ---
> v9: change title, s/box/boxed/
> v8: improve commit message, defer some implementation, rebase without
> gen_err_check()
> v7: rebase to master
> v6: rebase to earlier changes
[...]
> diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py
> index e0f926b..60e9877 100644
> --- a/scripts/qapi-introspect.py
> +++ b/scripts/qapi-introspect.py
> @@ -154,14 +154,14 @@ const char %(c_name)s[] = %(c_string)s;
> for m in variants.variants]})
>
> def visit_command(self, name, info, arg_type, ret_type,
> - gen, success_response):
> + gen, success_response, box):
You missed a box here. Can touch up on commit.
> arg_type = arg_type or self._schema.the_empty_object_type
> ret_type = ret_type or self._schema.the_empty_object_type
> self._gen_json(name, 'command',
> {'arg-type': self._use_type(arg_type),
> 'ret-type': self._use_type(ret_type)})
>
> - def visit_event(self, name, info, arg_type):
> + def visit_event(self, name, info, arg_type, box):
Likewise.
> arg_type = arg_type or self._schema.the_empty_object_type
> self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)})
>
[...]
- [Qemu-devel] [PATCH for-2.7 v9 00/17] qapi netdev_add introspection (post-introspection cleanups subset F), Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 03/17] qapi: Special case c_name() for empty type, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 02/17] qapi: Require all branches of flat union enum to be covered, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 05/17] qapi: Add type.is_empty() helper, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 07/17] qapi-event: Simplify visit of non-implicit data, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 04/17] qapi: Hide tag_name data member of variants, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 06/17] qapi: Drop useless gen_err_check(), Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels, Eric Blake, 2016/07/13
- Re: [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels,
Markus Armbruster <=
- [Qemu-devel] [PATCH v9 01/17] net: use Netdev instead of NetClientOptions in client init, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 09/17] qapi: Implement boxed types for commands/events, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 13/17] net: Use correct type for bool flag, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 11/17] block: Simplify drive-mirror, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 15/17] option: make parse_option_bool/number non-static, Eric Blake, 2016/07/13
- [Qemu-devel] [PATCH v9 10/17] block: Simplify block_set_io_throttle, Eric Blake, 2016/07/13