qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	qiaonuohan@cn.fujitsu.com, Ronen Hod <rhod@redhat.com>,
	lcapitulino@redhat.com
Subject: Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)
Date: Fri, 14 Jun 2013 12:09:33 +0100	[thread overview]
Message-ID: <51BAF9ED.4000206@redhat.com> (raw)
In-Reply-To: <20130614095244.GA24720@t430s.nay.redhat.com>

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

On 06/14/2013 10:52 AM, Amos Kong wrote:

>>From 2b39fe0f380eea6a96de3589b3d148673d28c1ff Mon Sep 17 00:00:00 2001
> From: Amos Kong <akong@redhat.com>
> Date: Fri, 7 Jun 2013 18:02:21 +0800
> Subject: [PATCH] full introspection support for QMP
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  qapi-schema.json         |  6 ++++++
>  qmp-commands.hx          | 23 +++++++++++++++++++++++
>  qmp.c                    | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>  scripts/qapi-commands.py |  2 +-
>  scripts/qapi-types.py    | 42 +++++++++++++++++++++++++++++++++++++++++-
>  scripts/qapi-visit.py    |  2 +-
>  scripts/qapi.py          | 13 ++++++++++++-
>  7 files changed, 130 insertions(+), 4 deletions(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index ef1f657..128cc58 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3618,3 +3618,9 @@
>              '*cpuid-input-ecx': 'int',
>              'cpuid-register': 'X86CPURegister32',
>              'features': 'int' } }
> +
> +{ 'type': 'SchemaData',
> +  'data': { 'type': 'str', 'name': 'str', '*data': 'str', '*returns': 'str' } }
> +
> +{ 'command': 'query-qmp-schema', 'data': { '*type': 'str', '*name': 'str' },
> +  'returns': ['SchemaData'] }

Needs documentation, and a since 1.6 notation in the docs (assuming that
we still make it in time for 1.6).  Also, see my other mail complaining
that this is not structured enough, yet.

> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index ffd130e..fc56fba 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -2932,3 +2932,26 @@ Example:

> +
> +EQMP
> \ No newline at end of file

Fix that.


>  }
>  
> +SchemaDataList * qmp_query_qmp_schema(bool has_type, const char * type,

No space after '*' when declaring a pointer return or pointer argument.
 Should be:

SchemaDataList *qmp_query_qmp_schema(bool has_type, const char *type,

> +++ b/scripts/qapi-types.py

> +
> +struct qmp_schem {

Aren't structs supposed to be named in CamelCase?

> +const char *type;
> +const char *name;
> +const char *data;
> +const char *returns;
> +} qmp_schema_table[] = {
> +"""
> +
> +for i in exprs_all[1]:
> +    print i
> +
> +    data = returns = ""
> +    type = i.keys()[0]
> +    name = i[type]
> +    for k in i.keys():
> +        if isinstance(i[k], OrderedDict):
> +            ret = {}
> +            for key in i[k]:
> +                ret[key] = i[k][key]
> +            i[k] = ret
> +
> +    if i.has_key('data'):
> +        data = i['data']

I think this is where you'd need to do more processing of data to spit
it out in a more structured format, but my python is too weak to
actually write that conversion.

-- 
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: 621 bytes --]

  parent reply	other threads:[~2013-06-14 11:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 13:40 [Qemu-devel] RFC: Full introspection support for QMP Amos Kong
2013-05-22 14:44 ` Kevin Wolf
2013-05-22 16:14   ` Anthony Liguori
2013-05-23  8:18     ` Kevin Wolf
2013-05-23 12:08       ` Anthony Liguori
2013-05-23 12:40         ` Luiz Capitulino
2013-05-23 12:52           ` Anthony Liguori
2013-05-23 12:54         ` Kevin Wolf
2013-05-23 13:52           ` Anthony Liguori
2013-05-23 14:17             ` Eric Blake
2013-05-23 14:29             ` Kevin Wolf
2013-05-22 17:56 ` Luiz Capitulino
2013-05-23 12:58 ` Eric Blake
2013-06-07 10:12 ` [Qemu-devel] RFC: Full introspection support for QMP (with draft patch) Amos Kong
2013-06-07 10:17   ` Amos Kong
2013-06-14  9:52     ` Amos Kong
2013-06-14 10:59       ` Eric Blake
2013-06-14 11:09       ` Eric Blake [this message]
2013-06-18 12:21         ` 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=51BAF9ED.4000206@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=rhod@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).