qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP
Date: Mon, 03 Feb 2014 17:33:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

On 01/23/2014 07:46 AM, Amos Kong wrote:
> This patch introduces a new monitor command to query QMP schema
> information, the return data is a range of schema structs, which
> contains the useful metadata to help management to check supported
> features, QMP commands detail, etc.
> 
> We use qapi-introspect.py to parse all json definition in
> qapi-schema.json, and generate a range of dictionaries with metadata.
> The query command will visit the dictionaries and fill the data
> to allocated struct tree. Then QMP infrastructure will convert
> the tree to json string and return to QMP client.
> 
> TODO:

Do we still want this TODO in the commit message?  It would be nice to
get both of these features (introspection, and events described in qapi)
in for 2.0; I'm trying to spend some review time to help get us there.

> Wenchao Xia is working to convert QMP events to qapi-schema.json,
> then event can also be queried by this interface.
> 
> I will introduce another command 'query-qga-schema' to query QGA
> schema information, it's easy to add this support based on this
> patch.

Yes, we want that too :)  Have you started that patch, or are you trying
to get more feedback on this patch to make sure you're on the right track?

> 
> Signed-off-by: Amos Kong <address@hidden>
> ---
>  qapi-schema.json |  11 +++
>  qmp-commands.hx  |  42 +++++++++++
>  qmp.c            | 215 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 268 insertions(+)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index c63f0ca..6033383 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -4411,3 +4411,14 @@
>      'reference-type': 'String',
>      'type': 'DataObjectType',
>      'unionobj': 'DataObjectUnion' } }
> +
> +##
> +# @query-qmp-schema
> +#
> +# Query QMP schema information
> +#
> +# @returns: list of @DataObject
> +#
> +# Since: 1.8

2.0

And here's where an optional bool on whether to expand may be
worthwhile, as well as an optional argument allowing callers to filter data.

> +##
> +{ 'command': 'query-qmp-schema', 'returns': ['DataObject'] }

> +Return a json-object with the following information:
> +
> +- "name": qmp schema name (json-string)
> +- "type": qmp schema type, it can be 'comand', 'type', 'enum', 'union'

s/comand/command/

> +++ b/qmp.c
> +static DataObjectMember *qobject_to_dataobjmem(QObject *data)
> +{
> +
> +    DataObjectMember *member = g_malloc0(sizeof(DataObjectMember));

The blank line here looks unusual.

I didn't look at the code very closely; I want to look at the generated
.h file first.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]