Having two files in the tree both named qapi-schema.json just adds
confusion. Rename these files to {qmp,qga}-schema to make it
obvious which schema is in effect, and relocate qga into the common
qapi/ subdirectory. Update all build rules that refer to the file
names, and adjust other documentation and comment references that
need to refer to the new file names.
Maintainer-wise, this means that qapi/qga-schema.json continues
to belong to Michael as QGA maintainer, but now also notifies
Markus and Eric as QAPI maintainers, alongside all the other
QMP QAPI files, matching how other .json QAPI modules belong
to multiple maintainer blurbs. Also, fix a stale reference to
a file removed in commit eb815e248f.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
v2: rebase on top of Markus' work that already moved
qapi-schema.json to qapi/
---
docs/devel/writing-qmp-commands.txt | 2 +-
docs/interop/qmp-intro.txt | 6 +++---
Makefile | 12 ++++++------
qga/qapi-schema.json => qapi/qga-schema.json | 0
qapi/{qapi-schema.json => qmp-schema.json} | 0
MAINTAINERS | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
rename qga/qapi-schema.json => qapi/qga-schema.json (100%)
rename qapi/{qapi-schema.json => qmp-schema.json} (100%)
diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-commands.txt
index 9dfc62bf5a3..1cd3dbf48ac 100644
--- a/docs/devel/writing-qmp-commands.txt
+++ b/docs/devel/writing-qmp-commands.txt
@@ -13,7 +13,7 @@ start with docs/interop/qmp-intro.txt.
== Overview ==
Generally speaking, the following steps should be taken in order to write a
-new QMP command.
+new QMP command (similar steps for QGA).
1. Define the command and any types it needs in the appropriate QAPI
schema module.
diff --git a/docs/interop/qmp-intro.txt b/docs/interop/qmp-intro.txt
index 900d69d6128..19ac6c573b6 100644
--- a/docs/interop/qmp-intro.txt
+++ b/docs/interop/qmp-intro.txt
@@ -72,14 +72,14 @@ Escape character is '^]'.
{ "execute": "query-status" }
{
"return": {
- "status": "prelaunch",
- "singlestep": false,
+ "status": "prelaunch",
+ "singlestep": false,
"running": false
}
}
Please refer to docs/interop/qemu-qmp-ref.* for a complete command
-reference, generated from qapi/qapi-schema.json.
+reference, generated from qapi/qmp-schema.json.
QMP wiki page
-------------
diff --git a/Makefile b/Makefile
index d71dd5bea41..f5c2ace8b30 100644
--- a/Makefile
+++ b/Makefile
@@ -570,14 +570,14 @@ qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h \
qga/qapi-generated/qga-qapi-visit.c qga/qapi-generated/qga-qapi-visit.h \
qga/qapi-generated/qga-qapi-commands.h qga/qapi-generated/qga-qapi-commands.c \
qga/qapi-generated/qga-qapi-doc.texi: \
-qga/qapi-generated/qapi-gen-timestamp ;
-qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
+qga/qapi-generated/qga-gen-timestamp ;
+qga/qapi-generated/qga-gen-timestamp: $(SRC_PATH)/qapi/qga-schema.json $(qapi-py)
$(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \
-o qga/qapi-generated -p "qga-" $<, \
"GEN","$(@:%-timestamp=%)")
@>$@
-qapi-modules = $(SRC_PATH)/qapi/qapi-schema.json $(SRC_PATH)/qapi/common.json \
+qmp-modules = $(SRC_PATH)/qapi/qmp-schema.json $(SRC_PATH)/qapi/common.json \
$(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \
$(SRC_PATH)/qapi/char.json \
$(SRC_PATH)/qapi/crypto.json \
@@ -665,8 +665,8 @@ qapi/qapi-events-transaction.c qapi/qapi-events-transaction.h \
qapi/qapi-events-ui.c qapi/qapi-events-ui.h \
qapi/qapi-introspect.h qapi/qapi-introspect.c \
qapi/qapi-doc.texi: \
-qapi-gen-timestamp ;
-qapi-gen-timestamp: $(qapi-modules) $(qapi-py)
+qmp-gen-timestamp ;
+qmp-gen-timestamp: $(qmp-modules) $(qapi-py)
$(call quiet-command,$(PYTHON_UTF8) $(SRC_PATH)/scripts/qapi-gen.py \
-o "qapi" -b $<, \
"GEN","$(@:%-timestamp=%)")
@@ -730,7 +730,7 @@ clean:
rm -f trace/generated-tracers-dtrace.dtrace*
rm -f trace/generated-tracers-dtrace.h*
rm -f $(foreach f,$(GENERATED_FILES),$(f) $(f)-timestamp)
- rm -f qapi-gen-timestamp
+ rm -f qmp-gen-timestamp
rm -rf qga/qapi-generated
for d in $(ALL_SUBDIRS); do \
if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
diff --git a/qga/qapi-schema.json b/qapi/qga-schema.json
similarity index 100%
rename from qga/qapi-schema.json
rename to qapi/qga-schema.json
diff --git a/qapi/qapi-schema.json b/qapi/qmp-schema.json
similarity index 100%
rename from qapi/qapi-schema.json
rename to qapi/qmp-schema.json
diff --git a/MAINTAINERS b/MAINTAINERS
index 24b70169bc3..4a4b7aa2a64 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1581,7 +1581,6 @@ QAPI Schema
M: Eric Blake <eblake@redhat.com>
M: Markus Armbruster <armbru@redhat.com>
S: Supported
-F: qapi-schema.json
F: qapi/*.json
T: git git://repo.or.cz/qemu/armbru.git qapi-next
@@ -1603,6 +1602,7 @@ QEMU Guest Agent
M: Michael Roth <mdroth@linux.vnet.ibm.com>
S: Maintained
F: qga/
+F: qapi/qga-schema.json
F: qemu-ga.texi
F: scripts/qemu-guest-agent/
F: tests/test-qga.c
--
2.14.3
Eric Blake <eblake@redhat.com> writes:
> Having two files in the tree both named qapi-schema.json just adds
> confusion. Rename these files to {qmp,qga}-schema to make it
> obvious which schema is in effect, and relocate qga into the common
> qapi/ subdirectory. Update all build rules that refer to the file
> names, and adjust other documentation and comment references that
> need to refer to the new file names.
>
> Maintainer-wise, this means that qapi/qga-schema.json continues
> to belong to Michael as QGA maintainer, but now also notifies
> Markus and Eric as QAPI maintainers, alongside all the other
> QMP QAPI files, matching how other .json QAPI modules belong
> to multiple maintainer blurbs. Also, fix a stale reference to
> a file removed in commit eb815e248f.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
We have three separate things: QAPI infrastructure, its use in QEMU
proper, and its use in QGA. We keep the former two in qapi/, and the
latter in qga/.
Giving the two qapi-schema.json different names is fine with me.
qga-schema.json is an obvious choice. qmp-schema.json less so, because
it's actually used for more than just QMP now. qemu-schema.json? Or
just keep the old name?
Splitting qapi/ into infrastructure and use now doesn't seem to be worth
the bother. I'd prefer to keep the use for QGA separate, though. The
case for moving them together would be stronger if they shared schema
parts. Matter of taste, I guess, and that means it's up to the QGA
maintainer. Michael?
If we decide to keep them separate, but still want MAINTAINERS' QAPI
Schema stanza to cover QGA, that's a one-liner.
On 04/20/2018 03:01 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> Having two files in the tree both named qapi-schema.json just adds
>> confusion. Rename these files to {qmp,qga}-schema to make it
>> obvious which schema is in effect, and relocate qga into the common
>> qapi/ subdirectory. Update all build rules that refer to the file
>> names, and adjust other documentation and comment references that
>> need to refer to the new file names.
>>
>> Maintainer-wise, this means that qapi/qga-schema.json continues
>> to belong to Michael as QGA maintainer, but now also notifies
>> Markus and Eric as QAPI maintainers, alongside all the other
>> QMP QAPI files, matching how other .json QAPI modules belong
>> to multiple maintainer blurbs. Also, fix a stale reference to
>> a file removed in commit eb815e248f.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> We have three separate things: QAPI infrastructure, its use in QEMU
> proper, and its use in QGA. We keep the former two in qapi/, and the
> latter in qga/.
And another thread raised the possibility of firmware.json (or
firmware.qapi, if we like patch 2) being in yet another directory.
>
> Giving the two qapi-schema.json different names is fine with me.
> qga-schema.json is an obvious choice. qmp-schema.json less so, because
> it's actually used for more than just QMP now. qemu-schema.json? Or
> just keep the old name?
qapi-schema.qapi sounds repetitive; qemu-schema.qapi seems reasonable,
if we need it. Also, remember that we have the QMP command
'query-qmp-schema', so the name qmp-schema makes some sense, even if the
file does cover more than QMP.
>
> Splitting qapi/ into infrastructure and use now doesn't seem to be worth
> the bother. I'd prefer to keep the use for QGA separate, though. The
> case for moving them together would be stronger if they shared schema
> parts. Matter of taste, I guess, and that means it's up to the QGA
> maintainer. Michael?
>
> If we decide to keep them separate, but still want MAINTAINERS' QAPI
> Schema stanza to cover QGA, that's a one-liner.
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
© 2016 - 2026 Red Hat, Inc.