From: Amos Kong <akong@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/2] qapi: change qapi to convert schema json
Date: Fri, 26 Jul 2013 11:39:04 +0800 [thread overview]
Message-ID: <20130726033904.GA9320@amosk.info> (raw)
In-Reply-To: <20130717160932.7dd328b3@redhat.com>
On Wed, Jul 17, 2013 at 04:09:32PM -0400, Luiz Capitulino wrote:
> On Tue, 16 Jul 2013 18:37:41 +0800
> Amos Kong <akong@redhat.com> wrote:
>
> > QMP schema is defined in a json file, it will be parsed by
> > qapi scripts and generate C files.
> >
> > We want to return the schema information to management,
> > this patch converts the json file to a string table in a
> > C head file, then we can use the json content.
> >
> > eg:
> > const char *const qmp_schema_table[] = {
> > "{ 'type': 'NameInfo', 'data': {'*name': 'str'} }",
> > "{ 'command': 'query-name', 'returns': 'NameInfo' }",
> > ...
> > }
> >
> > Signed-off-by: Amos Kong <akong@redhat.com>
> > ---
> > Makefile | 5 ++++-
> > scripts/qapi-commands.py | 2 +-
> > scripts/qapi-types.py | 47 ++++++++++++++++++++++++++++++++++++++++++++---
> > scripts/qapi-visit.py | 2 +-
> > scripts/qapi.py | 4 +++-
> > 5 files changed, 53 insertions(+), 7 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index c06bfab..2348bce 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -38,7 +38,7 @@ endif
> > endif
> >
> > GENERATED_HEADERS = config-host.h qemu-options.def
> > -GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
> > +GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h qmp-schema.h
> > GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
> >
> > GENERATED_HEADERS += trace/generated-events.h
> > @@ -223,6 +223,9 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> > qmp-commands.h qmp-marshal.c :\
> > $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> > $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, " GEN $@")
> > +qmp-schema.h:\
> > +$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> > + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." -i "$@" < $<, " GEN $@")
>
> What about qemu-ga?
We hadn't confirm with this implement way. It's easy to add a new
command to query qga schema info. I can do it in next version.
next prev parent reply other threads:[~2013-07-26 3:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 10:37 [Qemu-devel] [PATCH v2 0/2] QMP full introspection Amos Kong
2013-07-16 10:37 ` [Qemu-devel] [PATCH v2 1/2] qapi: change qapi to convert schema json Amos Kong
2013-07-17 20:09 ` Luiz Capitulino
2013-07-26 3:39 ` Amos Kong [this message]
2013-07-19 12:27 ` Eric Blake
2013-07-26 6:53 ` Amos Kong
2013-07-16 10:37 ` [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP Amos Kong
2013-07-16 10:48 ` Paolo Bonzini
2013-07-16 11:04 ` Amos Kong
2013-07-16 11:08 ` Paolo Bonzini
2013-07-16 12:04 ` Amos Kong
2013-07-16 12:18 ` Paolo Bonzini
2013-07-26 7:03 ` Amos Kong
2013-07-17 20:36 ` Luiz Capitulino
2013-07-19 20:26 ` Eric Blake
2013-07-26 7:21 ` Amos Kong
2013-07-19 22:05 ` Eric Blake
2013-07-26 7:51 ` Amos Kong
2013-07-26 11:52 ` Eric Blake
2013-11-27 2:32 ` Amos Kong
2013-11-27 9:51 ` Kevin Wolf
[not found] ` <20131220110001.GC2890@amosk.info>
2013-12-20 11:57 ` Amos Kong
2013-12-20 18:03 ` Paolo Bonzini
2013-12-23 8:11 ` Amos Kong
2013-12-23 6:32 ` Wenchao Xia
2013-12-23 7:15 ` 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=20130726033904.GA9320@amosk.info \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).