All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Amos Kong <akong@redhat.com>, qemu-devel@nongnu.org
Cc: qiaonuohan@cn.fujitsu.com, lcapitulino@redhat.com,
	mdroth@linux.vnet.ibm.com, xiawenc@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP
Date: Mon, 03 Feb 2014 17:33:29 -0700	[thread overview]
Message-ID: <52F03559.7020502@redhat.com> (raw)
In-Reply-To: <1390488396-16538-5-git-send-email-akong@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]

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 <akong@redhat.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2014-02-04  0:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 14:46 [Qemu-devel] [PATCH v4 0/5] QMP full introspection Amos Kong
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 1/5] qapi: introduce DataObject to describe dynamic structs Amos Kong
2014-02-03 19:56   ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 2/5] qapi: add qapi-introspect.py code generator Amos Kong
2014-01-24  9:12   ` Fam Zheng
2014-01-24  9:34     ` Amos Kong
2014-01-26  4:51       ` Amos Kong
2014-02-04  0:15   ` Eric Blake
2014-02-11  0:35     ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 3/5] qobject: introduce qobject_get_str() Amos Kong
2014-02-04  0:20   ` Eric Blake
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 4/5] qmp: full introspection support for QMP Amos Kong
2014-01-24 10:48   ` Fam Zheng
2014-01-27  8:17     ` Amos Kong
2014-01-27  8:50       ` Amos Kong
2014-01-27  9:38       ` Paolo Bonzini
2014-01-27 10:07         ` Amos Kong
2014-01-27 10:15           ` Paolo Bonzini
2014-01-27 10:46         ` Fam Zheng
2014-01-28 10:45           ` Amos Kong
2014-01-28 11:14             ` Paolo Bonzini
2014-01-28 13:58               ` Eric Blake
2014-01-29  8:12                 ` Fam Zheng
2014-02-04  0:33   ` Eric Blake [this message]
2014-01-23 14:46 ` [Qemu-devel] [PATCH v4 5/5] update docs/qmp-full-introspection.txt Amos Kong
2014-01-24 11:43   ` Paolo Bonzini
2014-01-24 13:07     ` Eric Blake
2014-01-24  8:42 ` [Qemu-devel] [PATCH v4 0/5] QMP full introspection Amos Kong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F03559.7020502@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.