[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1][ 14/23] qapi: add QMP output visiter
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v1][ 14/23] qapi: add QMP output visiter |
Date: |
Wed, 18 May 2011 09:44:32 +0100 |
On Wed, May 18, 2011 at 1:52 AM, Michael Roth <address@hidden> wrote:
> Type of Visiter class that serves as the inverse of the input visiter:
> it takes a series of native C types and uses their values to construct a
> corresponding QObject. The command marshaling/dispatcher functions will
> use this to convert the output of QMP functions into a QObject that can
> be sent over the wire.
>
> Signed-off-by: Michael Roth <address@hidden>
> ---
> qapi/qmp-output-visiter.c | 188
> +++++++++++++++++++++++++++++++++++++++++++++
> qapi/qmp-output-visiter.h | 14 ++++
> 2 files changed, 202 insertions(+), 0 deletions(-)
> create mode 100644 qapi/qmp-output-visiter.c
> create mode 100644 qapi/qmp-output-visiter.h
>
> diff --git a/qapi/qmp-output-visiter.c b/qapi/qmp-output-visiter.c
> new file mode 100644
> index 0000000..c8c03c0
> --- /dev/null
> +++ b/qapi/qmp-output-visiter.c
> @@ -0,0 +1,188 @@
License/copyright header?
> +#if 0
> +static void qmp_output_type_enum(Visiter *v, int *obj, const char *kind,
> const char *name, Error **errp)
> +{
> + QmpOutputVisiter *qov = to_qov(v);
> + qmp_output_add(qov, name, qstring_from_str(qapi_enum_int2str(*obj)));
> +}
> +#else
> +static void qmp_output_type_enum(Visiter *v, int *obj, const char *kind,
> const char *name, Error **errp)
> +{
> + int64_t value = *obj;
> + qmp_output_type_int(v, &value, name, errp);
> +}
> +#endif
Looks like string constants were used for enums before but now plain
integers are used instead. Please resolve the #if 0.
Stefan
- [Qemu-devel] [PATCH v1][ 08/23] qapi: add qapi-types.py code generator, (continued)
- [Qemu-devel] [PATCH v1][ 08/23] qapi: add qapi-types.py code generator, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 09/23] qapi: add qapi-visit.py code generator, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 10/23] qapi: add qapi-commands.py code generator, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 11/23] qapi: add qapi-types-core.h, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 12/23] qapi: add qapi-visit-core.h, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 15/23] qapi: add QAPI dealloc visiter, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 13/23] qapi: add QMP input visiter, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 16/23] qapi: add command registration/lookup functions, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 14/23] qapi: add QMP output visiter, Michael Roth, 2011/05/17
- Re: [Qemu-devel] [PATCH v1][ 14/23] qapi: add QMP output visiter,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v1][ 17/23] qapi: add QMP dispatch functions, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 19/23] qapi: test schema used for unit tests, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 20/23] qapi: add test-visiter, tests for gen. visiter code, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 21/23] qapi: Makefile changes to build test-visiter, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 18/23] qapi: add base declaration/types for QMP, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 22/23] qapi: add test-qmp-commands, tests for gen. marshalling/dispatch code, Michael Roth, 2011/05/17
- [Qemu-devel] [PATCH v1][ 23/23] qapi: Makefile changes to build test-qmp-commands, Michael Roth, 2011/05/17
- Re: [Qemu-devel] [PATCH v1 00/23] QAPI Infrastructure Round 1, Luiz Capitulino, 2011/05/18