[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 08/22] qapi: qapi_visit.py, support for visiting
From: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCH 08/22] qapi: qapi_visit.py, support for visiting non-pointer/embedded structs |
Date: |
Tue, 24 Jul 2012 17:21:40 -0500 |
User-agent: |
Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) |
Michael Roth <address@hidden> writes:
Reviewed-by: Anthony Liguori <address@hidden>
Regards,
Anthony Liguori
> Signed-off-by: Michael Roth <address@hidden>
> ---
> scripts/qapi_visit.py | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/scripts/qapi_visit.py b/scripts/qapi_visit.py
> index 864acb2..8f8cdca 100644
> --- a/scripts/qapi_visit.py
> +++ b/scripts/qapi_visit.py
> @@ -105,6 +105,15 @@ if (obj && (*obj)->%(prefix)shas_%(c_name)s) {
> if annotated:
> if isinstance(argentry['type'], types.ListType):
> ret += generate_visit_array_body(argname, argentry)
> + elif argentry.has_key('<embedded struct>'):
> + tmp_ptr_name = "%s_%s_ptr" %
> (c_var(field_prefix).replace(".", ""), c_var(argname))
> + ret += mcgen('''
> +%(type)s *%(tmp_ptr)s = &(*obj)->%(c_prefix)s%(c_name)s;
> +visit_type_%(type)s(m, (obj && *obj) ? &%(tmp_ptr)s : NULL, "%(name)s",
> errp);
> +''',
> + c_prefix=c_var(field_prefix),
> prefix=field_prefix,
> + type=type_name(argentry['type']),
> c_name=c_var(argname),
> + name=argname, tmp_ptr=tmp_ptr_name)
> else:
> ret += mcgen('''
> visit_type_%(type)s(m, obj ? &(*obj)->%(c_prefix)s%(c_name)s : NULL,
> "%(name)s", errp);
> --
> 1.7.9.5
- [Qemu-devel] [PATCH 04/22] qapi: qapi_visit.py, make code useable as module, (continued)
- [Qemu-devel] [PATCH 04/22] qapi: qapi_visit.py, make code useable as module, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 05/22] qapi: qapi_visit.py, support arrays and complex qapi definitions, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 03/22] qapi: qapi-commands.py -> qapi_commands.py, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 07/22] qapi: qapi_visit.py, support generating static functions, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 06/22] qapi: add visitor interfaces for arrays, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 08/22] qapi: qapi_visit.py, support for visiting non-pointer/embedded structs, Michael Roth, 2012/07/24
- Re: [Qemu-devel] [PATCH 08/22] qapi: qapi_visit.py, support for visiting non-pointer/embedded structs,
Anthony Liguori <=
- [Qemu-devel] [PATCH 09/22] qapi: QmpOutputVisitor, implement array handling, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 10/22] qapi: qapi.py, make json parser more robust, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 12/22] qom-fuse: workaround for truncated properties > 4096, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 11/22] qapi: add open-coded visitor for struct tm types, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 13/22] module additions for schema registration, Michael Roth, 2012/07/24
- [Qemu-devel] [PATCH 15/22] qidl: Add documentation, Michael Roth, 2012/07/24