From: Fam Zheng <famz@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 v3 2/3] qapi: change qapi to convert schema json
Date: Mon, 06 Jan 2014 18:11:27 +0800 [thread overview]
Message-ID: <52CA814F.40406@redhat.com> (raw)
In-Reply-To: <1388923351-10556-3-git-send-email-akong@redhat.com>
On 2014年01月05日 20:02, Amos Kong 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 in QEMU code.
>
> eg: (qmp-schema.h)
> 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 | 48 +++++++++++++++++++++++++++++++++++++++++++++---
> scripts/qapi-visit.py | 2 +-
> scripts/qapi.py | 20 +++++++++++++++-----
> 5 files changed, 66 insertions(+), 11 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index bdff4e4..2c29755 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -45,7 +45,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
> @@ -229,6 +229,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 "." -s "$@" < $<, " GEN $@")
>
It would be nice to also add this file to .gitignore together with this
patch.
Fam
next prev parent reply other threads:[~2014-01-06 10:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-05 12:02 [Qemu-devel] [PATCH v3 0/3] QMP full introspection Amos Kong
2014-01-05 12:02 ` [Qemu-devel] [PATCH v3 1/3] qapi: cleanup redundant variable Amos Kong
2014-01-05 12:02 ` [Qemu-devel] [PATCH v3 2/3] qapi: change qapi to convert schema json Amos Kong
2014-01-06 7:53 ` Fam Zheng
2014-01-06 10:11 ` Fam Zheng [this message]
2014-01-22 18:06 ` Luiz Capitulino
2014-01-23 3:05 ` Amos Kong
2014-01-23 3:25 ` Amos Kong
2014-01-23 13:30 ` Luiz Capitulino
2014-01-05 12:02 ` [Qemu-devel] [PATCH v3 3/3] qmp: full introspection support for QMP Amos Kong
2014-01-06 9:37 ` Fam Zheng
2014-01-09 9:49 ` Amos Kong
2014-01-22 18:18 ` Luiz Capitulino
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=52CA814F.40406@redhat.com \
--to=famz@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 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).