提交 23eb9e6b 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2017-01-16' into staging

QAPI patches for 2017-01-16

# gpg: Signature made Mon 16 Jan 2017 09:26:49 GMT
# gpg:                using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2017-01-16: (180 commits)
  build-sys: add qapi doc generation targets
  build-sys: add txt documentation rules
  build-sys: use a generic TEXI2MAN rule
  build-sys: remove dvi doc generation
  build-sys: use --no-split for info
  docs: add qemu logo to pdf
  qapi: add qapi2texi script
  qmp-events: move 'MIGRATION_PASS' doc to schema
  qmp-events: move 'DUMP_COMPLETED' doc to schema
  qmp-events: move 'MEM_UNPLUG_ERROR' doc to schema
  qmp-events: move 'VSERPORT_CHANGE' doc to schema
  qmp-events: move 'QUORUM_REPORT_BAD' doc to schema
  qmp-events: move 'QUORUM_FAILURE' doc to schema
  qmp-events: move 'GUEST_PANICKED' doc to schema
  qmp-events: move 'BALLOON_CHANGE' doc to schema
  qmp-events: move 'ACPI_DEVICE_OST' doc to schema
  qmp-events: move 'MIGRATION' doc to schema
  qmp-events: move 'SPICE_MIGRATE_COMPLETED' doc to schema
  qmp-events: move 'SPICE_DISCONNECTED' doc to schema
  qmp-events: move 'SPICE_INITIALIZED' doc to schema
  ...
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
/qmp-marshal.c /qmp-marshal.c
/qemu-doc.html /qemu-doc.html
/qemu-doc.info /qemu-doc.info
/qemu-doc.txt
/qemu-img /qemu-img
/qemu-nbd /qemu-nbd
/qemu-options.def /qemu-options.def
...@@ -60,7 +61,6 @@ ...@@ -60,7 +61,6 @@
*.a *.a
*.aux *.aux
*.cp *.cp
*.dvi
*.exe *.exe
*.msi *.msi
*.dll *.dll
...@@ -105,6 +105,15 @@ ...@@ -105,6 +105,15 @@
/pc-bios/optionrom/kvmvapic.img /pc-bios/optionrom/kvmvapic.img
/pc-bios/s390-ccw/s390-ccw.elf /pc-bios/s390-ccw/s390-ccw.elf
/pc-bios/s390-ccw/s390-ccw.img /pc-bios/s390-ccw/s390-ccw.img
/docs/qemu-ga-ref.html
/docs/qemu-ga-ref.txt
/docs/qemu-qmp-ref.html
/docs/qemu-qmp-ref.txt
docs/qemu-ga-ref.info*
docs/qemu-qmp-ref.info*
/qemu-ga-qapi.texi
/qemu-qapi.texi
*.tps
.stgit-* .stgit-*
cscope.* cscope.*
tags tags
......
...@@ -80,8 +80,8 @@ GENERATED_HEADERS += module_block.h ...@@ -80,8 +80,8 @@ GENERATED_HEADERS += module_block.h
Makefile: ; Makefile: ;
configure: ; configure: ;
.PHONY: all clean cscope distclean dvi html info install install-doc \ .PHONY: all clean cscope distclean html info install install-doc \
pdf recurse-all speed test dist msi FORCE pdf txt recurse-all speed test dist msi FORCE
$(call set-vpath, $(SRC_PATH)) $(call set-vpath, $(SRC_PATH))
...@@ -90,7 +90,9 @@ LIBS+=-lz $(LIBS_TOOLS) ...@@ -90,7 +90,9 @@ LIBS+=-lz $(LIBS_TOOLS)
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
ifdef BUILD_DOCS ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8
DOCS+=docs/qemu-qmp-ref.html docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7
DOCS+=docs/qemu-ga-ref.html docs/qemu-ga-ref.txt docs/qemu-ga-ref.7
ifdef CONFIG_VIRTFS ifdef CONFIG_VIRTFS
DOCS+=fsdev/virtfs-proxy-helper.1 DOCS+=fsdev/virtfs-proxy-helper.1
endif endif
...@@ -265,6 +267,7 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated ...@@ -265,6 +267,7 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
gen-out-type = $(subst .,-,$(suffix $@)) gen-out-type = $(subst .,-,$(suffix $@))
qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
qapi-py += $(SRC_PATH)/scripts/qapi2texi.py
qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
$(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py) $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
...@@ -387,12 +390,17 @@ distclean: clean ...@@ -387,12 +390,17 @@ distclean: clean
rm -f config-all-devices.mak config-all-disas.mak config.status rm -f config-all-devices.mak config-all-disas.mak config.status
rm -f po/*.mo tests/qemu-iotests/common.env rm -f po/*.mo tests/qemu-iotests/common.env
rm -f roms/seabios/config.mak roms/vgabios/config.mak rm -f roms/seabios/config.mak roms/vgabios/config.mak
rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps
rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
rm -f qemu-doc.vr rm -f qemu-doc.vr
rm -f config.log rm -f config.log
rm -f linux-headers/asm rm -f linux-headers/asm
rm -f qemu-ga-qapi.texi qemu-qapi.texi
rm -f docs/qemu-qmp-ref.7 docs/qemu-ga-ref.7
rm -f docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt
rm -f docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf
rm -f docs/qemu-qmp-ref.html docs/qemu-ga-ref.html
for d in $(TARGET_DIRS); do \ for d in $(TARGET_DIRS); do \
rm -rf $$d || exit 1 ; \ rm -rf $$d || exit 1 ; \
done done
...@@ -429,10 +437,14 @@ endif ...@@ -429,10 +437,14 @@ endif
install-doc: $(DOCS) install-doc: $(DOCS)
$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) $(SRC_PATH)/docs/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) docs/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) docs/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)"
ifdef CONFIG_POSIX ifdef CONFIG_POSIX
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
$(INSTALL_DATA) docs/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
ifneq ($(TOOLS),) ifneq ($(TOOLS),)
$(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1"
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
...@@ -440,6 +452,9 @@ ifneq ($(TOOLS),) ...@@ -440,6 +452,9 @@ ifneq ($(TOOLS),)
endif endif
ifneq (,$(findstring qemu-ga,$(TOOLS))) ifneq (,$(findstring qemu-ga,$(TOOLS)))
$(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8" $(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8"
$(INSTALL_DATA) docs/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) docs/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) docs/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"
endif endif
endif endif
ifdef CONFIG_VIRTFS ifdef CONFIG_VIRTFS
...@@ -527,21 +542,23 @@ ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \ ...@@ -527,21 +542,23 @@ ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \
ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h
# documentation # documentation
MAKEINFO=makeinfo MAKEINFO=makeinfo -D 'VERSION $(VERSION)'
MAKEINFOFLAGS=--no-headers --no-split --number-sections MAKEINFOFLAGS=--no-split --number-sections
TEXIFLAG=$(if $(V),,--quiet) TEXIFLAG=$(if $(V),,--quiet) --command='@set VERSION $(VERSION)'
%.dvi: %.texi
$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"GEN","$@")
%.html: %.texi %.html: %.texi
$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \ $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
"GEN","$@") --html $< -o $@,"GEN","$@")
%.info: %.texi %.info: %.texi
$(call quiet-command,$(MAKEINFO) $< -o $@,"GEN","$@") $(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) $< -o $@,"GEN","$@")
%.txt: %.texi
$(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --no-headers \
--plaintext $< -o $@,"GEN","$@")
%.pdf: %.texi %.pdf: %.texi
$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"GEN","$@") $(call quiet-command,texi2pdf $(TEXIFLAG) -I $(SRC_PATH) -I . $< -o $@,"GEN","$@")
qemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool qemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
...@@ -555,47 +572,36 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt ...@@ -555,47 +572,36 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
qemu-qapi.texi: $(qapi-modules) $(qapi-py)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN" "$@")
qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
$(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
$(POD2MAN) --section=1 --center=" " --release=" " qemu.pod > $@, \
"GEN","$@")
qemu.1: qemu-option-trace.texi qemu.1: qemu-option-trace.texi
qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi qemu-img.1: qemu-img.texi qemu-option-trace.texi qemu-img-cmds.texi
$(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
$(POD2MAN) --section=1 --center=" " --release=" " qemu-img.pod > $@, \
"GEN","$@")
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
$(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
$(POD2MAN) --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
"GEN","$@")
qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi qemu-nbd.8: qemu-nbd.texi qemu-option-trace.texi
$(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
$(POD2MAN) --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
"GEN","$@")
qemu-ga.8: qemu-ga.texi qemu-ga.8: qemu-ga.texi
$(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga.pod && \
$(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \
"GEN","$@")
dvi: qemu-doc.dvi html: qemu-doc.html docs/qemu-qmp-ref.html docs/qemu-ga-ref.html
html: qemu-doc.html info: qemu-doc.info docs/qemu-qmp-ref.info docs/qemu-ga-ref.info
info: qemu-doc.info pdf: qemu-doc.pdf docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf
pdf: qemu-doc.pdf txt: qemu-doc.txt docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ qemu-doc.html qemu-doc.info qemu-doc.pdf: \
qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \
qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \
qemu-monitor-info.texi qemu-monitor-info.texi
docs/qemu-ga-ref.dvi docs/qemu-ga-ref.html docs/qemu-ga-ref.info docs/qemu-ga-ref.pdf docs/qemu-ga-ref.txt docs/qemu-ga-ref.7: \
docs/qemu-ga-ref.texi qemu-ga-qapi.texi
docs/qemu-qmp-ref.dvi docs/qemu-qmp-ref.html docs/qemu-qmp-ref.info docs/qemu-qmp-ref.pdf docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7: \
docs/qemu-qmp-ref.texi qemu-qapi.texi
ifdef CONFIG_WIN32 ifdef CONFIG_WIN32
INSTALLER = qemu-setup-$(VERSION)$(EXESUF) INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
...@@ -688,7 +694,7 @@ help: ...@@ -688,7 +694,7 @@ help:
@echo ' docker - Help about targets running tests inside Docker containers' @echo ' docker - Help about targets running tests inside Docker containers'
@echo '' @echo ''
@echo 'Documentation targets:' @echo 'Documentation targets:'
@echo ' dvi html info pdf' @echo ' html info pdf txt'
@echo ' - Build documentation in specified format' @echo ' - Build documentation in specified format'
@echo '' @echo ''
ifdef CONFIG_WIN32 ifdef CONFIG_WIN32
......
...@@ -6198,7 +6198,7 @@ fi ...@@ -6198,7 +6198,7 @@ fi
# build tree in object directory in case the source is not in the current directory # build tree in object directory in case the source is not in the current directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests"
DIRS="$DIRS fsdev" DIRS="$DIRS docs fsdev"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS roms/seabios roms/vgabios"
DIRS="$DIRS qapi-generated" DIRS="$DIRS qapi-generated"
......
...@@ -44,40 +44,154 @@ Input must be ASCII (although QMP supports full Unicode strings, the ...@@ -44,40 +44,154 @@ Input must be ASCII (although QMP supports full Unicode strings, the
QAPI parser does not). At present, there is no place where a QAPI QAPI parser does not). At present, there is no place where a QAPI
schema requires the use of JSON numbers or null. schema requires the use of JSON numbers or null.
=== Comments ===
Comments are allowed; anything between an unquoted # and the following Comments are allowed; anything between an unquoted # and the following
newline is ignored. Although there is not yet a documentation newline is ignored.
generator, a form of stylized comments has developed for consistently
documenting details about an expression and when it was added to the A multi-line comment that starts and ends with a '##' line is a
schema. The documentation is delimited between two lines of ##, then documentation comment. These are parsed by the documentation
the first line names the expression, an optional overview is provided, generator, which recognizes certain markup detailed below.
then individual documentation about each member of 'data' is provided,
and finally, a 'Since: x.y.z' tag lists the release that introduced
the expression. Optional members are tagged with the phrase ==== Documentation markup ====
'#optional', often with their default value; and extensions added
after the expression was first released are also given a '(since Comment text starting with '=' is a section title:
x.y.z)' comment. For example:
# = Section title
##
# @BlockStats: Double the '=' for a subsection title:
#
# Statistics of a virtual block device or a block backing device. # == Subection title
#
# @device: #optional If the stats are for a virtual block device, the name '|' denotes examples:
# corresponding to the virtual block device.
# # | Text of the example, may span
# @stats: A @BlockDeviceStats for the device. # | multiple lines
#
# @parent: #optional This describes the file block device if it has one. '*' starts an itemized list:
#
# @backing: #optional This describes the backing block device if it has one. # * First item, may span
# (Since 2.0) # multiple lines
# # * Second item
# Since: 0.14.0
## You can also use '-' instead of '*'.
{ 'struct': 'BlockStats',
'data': {'*device': 'str', 'stats': 'BlockDeviceStats', A decimal number followed by '.' starts a numbered list:
'*parent': 'BlockStats',
'*backing': 'BlockStats'} } # 1. First item, may span
# multiple lines
# 2. Second item
The actual number doesn't matter. You could even use '*' instead of
'2.' for the second item.
Lists can't be nested. Blank lines are currently not supported within
lists.
Additional whitespace between the initial '#' and the comment text is
permitted.
*foo* and _foo_ are for strong and emphasis styles respectively (they
do not work over multiple lines). @foo is used to reference a name in
the schema.
Example:
##
# = Section
# == Subsection
#
# Some text foo with *strong* and _emphasis_
# 1. with a list
# 2. like that
#
# And some code:
# | $ echo foo
# | -> do this
# | <- get that
#
##
==== Expression documentation ====
Each expression that isn't an include directive must be preceded by a
documentation block. Such blocks are called expression documentation
blocks.
The documentation block consists of a first line naming the
expression, an optional overview, a description of each argument (for
commands and events) or member (for structs, unions and alternates),
and optional tagged sections.
FIXME: the parser accepts these things in almost any order.
Optional arguments / members are tagged with the phrase '#optional',
often with their default value; and extensions added after the
expression was first released are also given a '(since x.y.z)'
comment.
A tagged section starts with one of the following words:
"Note:"/"Notes:", "Since:", "Example"/"Examples", "Returns:", "TODO:".
The section ends with the start of a new section.
A 'Since: x.y.z' tagged section lists the release that introduced the
expression.
For example:
##
# @BlockStats:
#
# Statistics of a virtual block device or a block backing device.
#
# @device: #optional If the stats are for a virtual block device, the name
# corresponding to the virtual block device.
#
# @node-name: #optional The node name of the device. (since 2.3)
#
# ... more members ...
#
# Since: 0.14.0
##
{ 'struct': 'BlockStats',
'data': {'*device': 'str', '*node-name': 'str',
... more members ... } }
##
# @query-blockstats:
#
# Query the @BlockStats for all virtual block devices.
#
# @query-nodes: #optional If true, the command will query all the
# block nodes ... explain, explain ... (since 2.3)
#
# Returns: A list of @BlockStats for each virtual block devices.
#
# Since: 0.14.0
#
# Example:
#
# -> { "execute": "query-blockstats" }
# <- {
# ... lots of output ...
# }
#
##
{ 'command': 'query-blockstats',
'data': { '*query-nodes': 'bool' },
'returns': ['BlockStats'] }
==== Free-form documentation ====
A documentation block that isn't an expression documentation block is
a free-form documentation block. These may be used to provide
additional text and structuring content.
=== Schema overview ===
The schema sets up a series of types, as well as commands and events The schema sets up a series of types, as well as commands and events
that will use those types. Forward references are allowed: the parser that will use those types. Forward references are allowed: the parser
......
\input texinfo
@setfilename qemu-ga-ref.info
@exampleindent 0
@paragraphindent 0
@settitle QEMU Guest Agent Protocol Reference
@iftex
@center @image{docs/qemu_logo}
@end iftex
@copying
This is the QEMU Guest Agent Protocol reference manual.
Copyright @copyright{} 2016 The QEMU Project developers
@quotation
This manual is free documentation: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of the
License, or (at your option) any later version.
This manual is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this manual. If not, see http://www.gnu.org/licenses/.
@end quotation
@end copying
@dircategory QEMU
@direntry
* QEMU-GA-Ref: (qemu-ga-ref). QEMU Guest Agent Protocol Reference
@end direntry
@titlepage
@title Guest Agent Protocol Reference Manual
@subtitle QEMU version @value{VERSION}
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top QEMU Guest Agent protocol reference
@end ifnottex
@menu
* API Reference::
* Commands and Events Index::
* Data Types Index::
@end menu
@node API Reference
@chapter API Reference
@c for texi2pod:
@c man begin DESCRIPTION
@include qemu-ga-qapi.texi
@c man end
@node Commands and Events Index
@unnumbered Commands and Events Index
@printindex fn
@node Data Types Index
@unnumbered Data Types Index
@printindex tp
@bye
\input texinfo
@setfilename qemu-qmp-ref.info
@exampleindent 0
@paragraphindent 0
@settitle QEMU QMP Reference Manual
@iftex
@center @image{docs/qemu_logo}
@end iftex
@copying
This is the QEMU QMP reference manual.
Copyright @copyright{} 2016 The QEMU Project developers
@quotation
This manual is free documentation: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 2 of the
License, or (at your option) any later version.
This manual is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this manual. If not, see http://www.gnu.org/licenses/.
@end quotation
@end copying
@dircategory QEMU
@direntry
* QEMU-QMP-Ref: (qemu-qmp-ref). QEMU QMP Reference Manual
@end direntry
@titlepage
@title QMP Reference Manual
@subtitle QEMU version @value{VERSION}
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top QEMU QMP reference
@end ifnottex
@menu
* API Reference::
* Commands and Events Index::
* Data Types Index::
@end menu
@node API Reference
@chapter API Reference
@c for texi2pod:
@c man begin DESCRIPTION
@include qemu-qapi.texi
@c man end
@node Commands and Events Index
@unnumbered Commands and Events Index
@printindex fn
@node Data Types Index
@unnumbered Data Types Index
@printindex tp
@bye
文件已添加
此差异已折叠。
此差异已折叠。
...@@ -16,8 +16,7 @@ QMP is JSON[1] based and features the following: ...@@ -16,8 +16,7 @@ QMP is JSON[1] based and features the following:
For detailed information on QMP's usage, please, refer to the following files: For detailed information on QMP's usage, please, refer to the following files:
o qmp-spec.txt QEMU Machine Protocol current specification o qmp-spec.txt QEMU Machine Protocol current specification
o qmp-commands.txt QMP supported commands (auto-generated at build-time) o qemu-qmp-ref.html QEMU QMP commands and events (auto-generated at build-time)
o qmp-events.txt List of available asynchronous events
[1] http://www.json.org [1] http://www.json.org
......
此差异已折叠。
此差异已折叠。
# -*- Mode: Python -*- # -*- Mode: Python -*-
#
# QAPI block definitions (vm related) ##
# = QAPI block definitions
##
# QAPI block core definitions # QAPI block core definitions
{ 'include': 'block-core.json' } { 'include': 'block-core.json' }
##
# == QAPI block definitions (vm unrelated)
##
## ##
# @BiosAtaTranslation: # @BiosAtaTranslation:
# #
...@@ -75,19 +81,33 @@ ...@@ -75,19 +81,33 @@
## ##
# @blockdev-snapshot-internal-sync: # @blockdev-snapshot-internal-sync:
# #
# Synchronously take an internal snapshot of a block device, when the format # Synchronously take an internal snapshot of a block device, when the
# of the image used supports it. # format of the image used supports it. If the name is an empty
# string, or a snapshot with name already exists, the operation will
# fail.
# #
# For the arguments, see the documentation of BlockdevSnapshotInternal. # For the arguments, see the documentation of BlockdevSnapshotInternal.
# #
# Returns: nothing on success # Returns: nothing on success
#
# If @device is not a valid block device, GenericError # If @device is not a valid block device, GenericError
#
# If any snapshot matching @name exists, or @name is empty, # If any snapshot matching @name exists, or @name is empty,
# GenericError # GenericError
#
# If the format of the image used does not support it, # If the format of the image used does not support it,
# BlockFormatFeatureNotSupported # BlockFormatFeatureNotSupported
# #
# Since: 1.7 # Since: 1.7
#
# Example:
#
# -> { "execute": "blockdev-snapshot-internal-sync",
# "arguments": { "device": "ide-hd0",
# "name": "snapshot0" }
# }
# <- { "return": {} }
#
## ##
{ 'command': 'blockdev-snapshot-internal-sync', { 'command': 'blockdev-snapshot-internal-sync',
'data': 'BlockdevSnapshotInternal' } 'data': 'BlockdevSnapshotInternal' }
...@@ -115,6 +135,24 @@ ...@@ -115,6 +135,24 @@
# If @id and @name are both not specified, GenericError # If @id and @name are both not specified, GenericError
# #
# Since: 1.7 # Since: 1.7
#
# Example:
#
# -> { "execute": "blockdev-snapshot-delete-internal-sync",
# "arguments": { "device": "ide-hd0",
# "name": "snapshot0" }
# }
# <- { "return": {
# "id": "1",
# "name": "snapshot0",
# "vm-state-size": 0,
# "date-sec": 1000012,
# "date-nsec": 10,
# "vm-clock-sec": 100,
# "vm-clock-nsec": 20
# }
# }
#
## ##
{ 'command': 'blockdev-snapshot-delete-internal-sync', { 'command': 'blockdev-snapshot-delete-internal-sync',
'data': { 'device': 'str', '*id': 'str', '*name': 'str'}, 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
...@@ -129,15 +167,21 @@ ...@@ -129,15 +167,21 @@
# #
# @id: #optional The name or QOM path of the guest device (since: 2.8) # @id: #optional The name or QOM path of the guest device (since: 2.8)
# #
# @force: @optional If true, eject regardless of whether the drive is locked. # @force: #optional If true, eject regardless of whether the drive is locked.
# If not specified, the default value is false. # If not specified, the default value is false.
# #
# Returns: Nothing on success # Returns: Nothing on success
#
# If @device is not a valid block device, DeviceNotFound # If @device is not a valid block device, DeviceNotFound
# #
# Notes: Ejecting a device will no media results in success # Notes: Ejecting a device with no media results in success
# #
# Since: 0.14.0 # Since: 0.14.0
#
# Example:
#
# -> { "execute": "eject", "arguments": { "device": "ide1-0-1" } }
# <- { "return": {} }
## ##
{ 'command': 'eject', { 'command': 'eject',
'data': { '*device': 'str', 'data': { '*device': 'str',
...@@ -204,6 +248,16 @@ ...@@ -204,6 +248,16 @@
# @tray-open: true if the tray has been opened or false if it has been closed # @tray-open: true if the tray has been opened or false if it has been closed
# #
# Since: 1.1 # Since: 1.1
#
# Example:
#
# <- { "event": "DEVICE_TRAY_MOVED",
# "data": { "device": "ide1-cd0",
# "id": "/machine/unattached/device[22]",
# "tray-open": true
# },
# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
#
## ##
{ 'event': 'DEVICE_TRAY_MOVED', { 'event': 'DEVICE_TRAY_MOVED',
'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } } 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
......
# -*- Mode: Python -*- # -*- Mode: Python -*-
#
# QAPI common definitions ##
# = QAPI common definitions
##
## ##
# @QapiErrorClass: # @QapiErrorClass:
...@@ -75,6 +77,21 @@ ...@@ -75,6 +77,21 @@
# Returns: A @VersionInfo object describing the current version of QEMU. # Returns: A @VersionInfo object describing the current version of QEMU.
# #
# Since: 0.14.0 # Since: 0.14.0
#
# Example:
#
# -> { "execute": "query-version" }
# <- {
# "return":{
# "qemu":{
# "major":0,
# "minor":11,
# "micro":5
# },
# "package":""
# }
# }
#
## ##
{ 'command': 'query-version', 'returns': 'VersionInfo' } { 'command': 'query-version', 'returns': 'VersionInfo' }
...@@ -97,6 +114,23 @@ ...@@ -97,6 +114,23 @@
# Returns: A list of @CommandInfo for all supported commands # Returns: A list of @CommandInfo for all supported commands
# #
# Since: 0.14.0 # Since: 0.14.0
#
# Example:
#
# -> { "execute": "query-commands" }
# <- {
# "return":[
# {
# "name":"query-balloon"
# },
# {
# "name":"system_powerdown"
# }
# ]
# }
#
# Note: This example has been shortened as the real response is too long.
#
## ##
{ 'command': 'query-commands', 'returns': ['CommandInfo'] } { 'command': 'query-commands', 'returns': ['CommandInfo'] }
......
# -*- Mode: Python -*- # -*- Mode: Python -*-
# #
# QAPI crypto definitions
##
# = QAPI crypto definitions
##
## ##
# @QCryptoTLSCredsEndpoint: # @QCryptoTLSCredsEndpoint:
......
此差异已折叠。
...@@ -78,14 +78,13 @@ ...@@ -78,14 +78,13 @@
# @SchemaInfo: # @SchemaInfo:
# #
# @name: the entity's name, inherited from @base. # @name: the entity's name, inherited from @base.
# The SchemaInfo is always referenced by this name.
# Commands and events have the name defined in the QAPI schema. # Commands and events have the name defined in the QAPI schema.
# Unlike command and event names, type names are not part of # Unlike command and event names, type names are not part of
# the wire ABI. Consequently, type names are meaningless # the wire ABI. Consequently, type names are meaningless
# strings here, although they are still guaranteed unique # strings here, although they are still guaranteed unique
# regardless of @meta-type. # regardless of @meta-type.
# #
# All references to other SchemaInfo are by name.
#
# @meta-type: the entity's meta type, inherited from @base. # @meta-type: the entity's meta type, inherited from @base.
# #
# Additional members depend on the value of @meta-type. # Additional members depend on the value of @meta-type.
...@@ -258,7 +257,7 @@ ...@@ -258,7 +257,7 @@
# #
# @ret-type: the name of the command's result type. # @ret-type: the name of the command's result type.
# #
# TODO @success-response (currently irrelevant, because it's QGA, not QMP) # TODO: @success-response (currently irrelevant, because it's QGA, not QMP)
# #
# Since: 2.5 # Since: 2.5
## ##
......
##
# = Rocker switch device
##
## ##
# @RockerSwitch: # @RockerSwitch:
# #
...@@ -22,6 +26,12 @@ ...@@ -22,6 +26,12 @@
# Returns: @Rocker information # Returns: @Rocker information
# #
# Since: 2.4 # Since: 2.4
#
# Example:
#
# -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
# <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
#
## ##
{ 'command': 'query-rocker', { 'command': 'query-rocker',
'data': { 'name': 'str' }, 'data': { 'name': 'str' },
...@@ -80,11 +90,21 @@ ...@@ -80,11 +90,21 @@
## ##
# @query-rocker-ports: # @query-rocker-ports:
# #
# Return rocker switch information. # Return rocker switch port information.
# #
# Returns: @Rocker information # Returns: a list of @RockerPort information
# #
# Since: 2.4 # Since: 2.4
#
# Example:
#
# -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
# <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
# "autoneg": "off", "link-up": true, "speed": 10000},
# {"duplex": "full", "enabled": true, "name": "sw1.2",
# "autoneg": "off", "link-up": true, "speed": 10000}
# ]}
#
## ##
{ 'command': 'query-rocker-ports', { 'command': 'query-rocker-ports',
'data': { 'name': 'str' }, 'data': { 'name': 'str' },
...@@ -215,9 +235,23 @@ ...@@ -215,9 +235,23 @@
# @tbl-id: #optional flow table ID. If tbl-id is not specified, returns # @tbl-id: #optional flow table ID. If tbl-id is not specified, returns
# flow information for all tables. # flow information for all tables.
# #
# Returns: @Rocker OF-DPA flow information # Returns: rocker OF-DPA flow information
# #
# Since: 2.4 # Since: 2.4
#
# Example:
#
# -> { "execute": "query-rocker-of-dpa-flows",
# "arguments": { "name": "sw1" } }
# <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
# "hits": 138,
# "cookie": 0,
# "action": {"goto-tbl": 10},
# "mask": {"in-pport": 4294901760}
# },
# {...more...},
# ]}
#
## ##
{ 'command': 'query-rocker-of-dpa-flows', { 'command': 'query-rocker-of-dpa-flows',
'data': { 'name': 'str', '*tbl-id': 'uint32' }, 'data': { 'name': 'str', '*tbl-id': 'uint32' },
...@@ -277,9 +311,28 @@ ...@@ -277,9 +311,28 @@
# @type: #optional group type. If type is not specified, returns # @type: #optional group type. If type is not specified, returns
# group information for all group types. # group information for all group types.
# #
# Returns: @Rocker OF-DPA group information # Returns: rocker OF-DPA group information
# #
# Since: 2.4 # Since: 2.4
#
# Example:
#
# -> { "execute": "query-rocker-of-dpa-groups",
# "arguments": { "name": "sw1" } }
# <- { "return": [ {"type": 0, "out-pport": 2,
# "pport": 2, "vlan-id": 3841,
# "pop-vlan": 1, "id": 251723778},
# {"type": 0, "out-pport": 0,
# "pport": 0, "vlan-id": 3841,
# "pop-vlan": 1, "id": 251723776},
# {"type": 0, "out-pport": 1,
# "pport": 1, "vlan-id": 3840,
# "pop-vlan": 1, "id": 251658241},
# {"type": 0, "out-pport": 0,
# "pport": 0, "vlan-id": 3840,
# "pop-vlan": 1, "id": 251658240}
# ]}
#
## ##
{ 'command': 'query-rocker-of-dpa-groups', { 'command': 'query-rocker-of-dpa-groups',
'data': { 'name': 'str', '*type': 'uint8' }, 'data': { 'name': 'str', '*type': 'uint8' },
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
# This work is licensed under the terms of the GNU GPL, version 2 or later. # This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory. # See the COPYING file in the top-level directory.
##
# = Tracing commands
##
## ##
# @TraceEventState: # @TraceEventState:
...@@ -59,6 +62,13 @@ ...@@ -59,6 +62,13 @@
# an error is returned. # an error is returned.
# #
# Since: 2.2 # Since: 2.2
#
# Example:
#
# -> { "execute": "trace-event-get-state",
# "arguments": { "name": "qemu_memalign" } }
# <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
#
## ##
{ 'command': 'trace-event-get-state', { 'command': 'trace-event-get-state',
'data': {'name': 'str', '*vcpu': 'int'}, 'data': {'name': 'str', '*vcpu': 'int'},
...@@ -84,6 +94,13 @@ ...@@ -84,6 +94,13 @@
# error is returned. # error is returned.
# #
# Since: 2.2 # Since: 2.2
#
# Example:
#
# -> { "execute": "trace-event-set-state",
# "arguments": { "name": "qemu_memalign", "enable": "true" } }
# <- { "return": {} }
#
## ##
{ 'command': 'trace-event-set-state', { 'command': 'trace-event-set-state',
'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
......
...@@ -697,21 +697,18 @@ ...@@ -697,21 +697,18 @@
# Returns: The length of the initial sublist that has been successfully # Returns: The length of the initial sublist that has been successfully
# processed. The guest agent maximizes this value. Possible cases: # processed. The guest agent maximizes this value. Possible cases:
# #
# 0: if the @vcpus list was empty on input. Guest state # - 0: if the @vcpus list was empty on input. Guest state
# has not been changed. Otherwise, # has not been changed. Otherwise,
# # - Error: processing the first node of @vcpus failed for the
# Error: processing the first node of @vcpus failed for the
# reason returned. Guest state has not been changed. # reason returned. Guest state has not been changed.
# Otherwise, # Otherwise,
# # - < length(@vcpus): more than zero initial nodes have been processed,
# < length(@vcpus): more than zero initial nodes have been processed,
# but not the entire @vcpus list. Guest state has # but not the entire @vcpus list. Guest state has
# changed accordingly. To retrieve the error # changed accordingly. To retrieve the error
# (assuming it persists), repeat the call with the # (assuming it persists), repeat the call with the
# successfully processed initial sublist removed. # successfully processed initial sublist removed.
# Otherwise, # Otherwise,
# # - length(@vcpus): call successful.
# length(@vcpus): call successful.
# #
# Since: 1.5 # Since: 1.5
## ##
......
...@@ -363,3 +363,15 @@ define unnest-vars ...@@ -363,3 +363,15 @@ define unnest-vars
$(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v)))) $(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v))))
$(eval $v := $(filter-out %/,$($v)))) $(eval $v := $(filter-out %/,$($v))))
endef endef
TEXI2MAN = $(call quiet-command, \
perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< $@.pod && \
$(POD2MAN) --section=$(subst .,,$(suffix $@)) --center=" " --release=" " $@.pod > $@, \
"GEN","$@")
%.1:
$(call TEXI2MAN)
%.7:
$(call TEXI2MAN)
%.8:
$(call TEXI2MAN)
此差异已折叠。
此差异已折叠。
...@@ -37,6 +37,7 @@ $inf = ""; ...@@ -37,6 +37,7 @@ $inf = "";
$ibase = ""; $ibase = "";
@ipath = (); @ipath = ();
$encoding = undef; $encoding = undef;
@args = ();
while ($_ = shift) { while ($_ = shift) {
if (/^-D(.*)$/) { if (/^-D(.*)$/) {
...@@ -162,7 +163,8 @@ while(<$inf>) { ...@@ -162,7 +163,8 @@ while(<$inf>) {
if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) { if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
$skipping = pop @skstack; $skipping = pop @skstack;
next; next;
} elsif ($ended =~ /^(?:example|smallexample|display)$/) { } elsif ($ended =~ /^(?:example|smallexample|display
|quotation|deftp|deftypefn)$/x) {
$shift = ""; $shift = "";
$_ = ""; # need a paragraph break $_ = ""; # need a paragraph break
} elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
...@@ -303,6 +305,7 @@ while(<$inf>) { ...@@ -303,6 +305,7 @@ while(<$inf>) {
$ic =~ s/\@(?:code|kbd)/C/; $ic =~ s/\@(?:code|kbd)/C/;
$ic =~ s/\@(?:dfn|var|emph|cite|i)/I/; $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
$ic =~ s/\@(?:file)/F/; $ic =~ s/\@(?:file)/F/;
$ic =~ s/\@(?:asis)//;
$_ = "\n=over 4\n"; $_ = "\n=over 4\n";
}; };
...@@ -323,10 +326,54 @@ while(<$inf>) { ...@@ -323,10 +326,54 @@ while(<$inf>) {
$_ = "\n=item ".join (" : ", @columns)."\n"; $_ = "\n=item ".join (" : ", @columns)."\n";
}; };
/^\@(quotation)\s*(.+)?$/ and do {
push @endwstack, $endw;
$endw = $1;
$_ = "\n$2:"
};
/^{(.*)}$|^(.*)$/ and $#args > 0 and do {
$kind = $args[0];
$arguments = $1 // "";
if ($endw eq "deftypefn") {
$ret = $args[1];
$fname = "B<$args[2]>";
$_ = $ret ? "$ret " : "";
$_ .= "$fname $arguments ($kind)";
} else {
$_ = "B<$args[1]> ($kind)\n\n$arguments";
}
@args = ();
};
/^\@(deftp)\s*(.+)?$/ and do {
push @endwstack, $endw;
$endw = $1;
$arg = $2;
$arg =~ s/{([^}]*)}/$1/g;
$arg =~ s/\@$//;
@args = split (/ /, $arg);
$_ = "";
};
/^\@(deftypefn)\s*(.+)?$/ and do {
push @endwstack, $endw;
$endw = $1;
$arg = $2;
$arg =~ s/{([^}]*)}/$1/g;
$arg =~ s/\@$//;
@args = split (/ /, $arg);
$_ = "";
};
/^\@itemx?\s*(.+)?$/ and do { /^\@itemx?\s*(.+)?$/ and do {
if (defined $1) { if (defined $1) {
# Entity escapes prevent munging by the <> processing below. if ($ic eq "") {
$_ = "\n=item $ic\&LT;$1\&GT;\n"; $_ = "\n=item $1\n";
} else {
# Entity escapes prevent munging by the <> processing below.
$_ = "\n=item $ic\&LT;$1\&GT;\n";
}
} else { } else {
$_ = "\n=item $ic\n"; $_ = "\n=item $ic\n";
$ic =~ y/A-Ya-y/B-Zb-z/; $ic =~ y/A-Ya-y/B-Zb-z/;
...@@ -388,6 +435,7 @@ sub postprocess ...@@ -388,6 +435,7 @@ sub postprocess
s/\@sc\{([^\}]*)\}/\U$1/g; s/\@sc\{([^\}]*)\}/\U$1/g;
s/\@file\{([^\}]*)\}/F<$1>/g; s/\@file\{([^\}]*)\}/F<$1>/g;
s/\@w\{([^\}]*)\}/S<$1>/g; s/\@w\{([^\}]*)\}/S<$1>/g;
s/\@t\{([^\}]*)\}/$1/g;
s/\@(?:dmn|math)\{([^\}]*)\}/$1/g; s/\@(?:dmn|math)\{([^\}]*)\}/$1/g;
# keep references of the form @ref{...}, print them bold # keep references of the form @ref{...}, print them bold
......
...@@ -352,6 +352,24 @@ qapi-schema += base-cycle-direct.json ...@@ -352,6 +352,24 @@ qapi-schema += base-cycle-direct.json
qapi-schema += base-cycle-indirect.json qapi-schema += base-cycle-indirect.json
qapi-schema += command-int.json qapi-schema += command-int.json
qapi-schema += comments.json qapi-schema += comments.json
qapi-schema += doc-bad-args.json
qapi-schema += doc-bad-symbol.json
qapi-schema += doc-duplicated-arg.json
qapi-schema += doc-duplicated-return.json
qapi-schema += doc-duplicated-since.json
qapi-schema += doc-empty-arg.json
qapi-schema += doc-empty-section.json
qapi-schema += doc-empty-symbol.json
qapi-schema += doc-interleaved-section.json
qapi-schema += doc-invalid-end.json
qapi-schema += doc-invalid-end2.json
qapi-schema += doc-invalid-return.json
qapi-schema += doc-invalid-section.json
qapi-schema += doc-invalid-start.json
qapi-schema += doc-missing-colon.json
qapi-schema += doc-missing-expr.json
qapi-schema += doc-missing-space.json
qapi-schema += doc-optional.json
qapi-schema += double-data.json qapi-schema += double-data.json
qapi-schema += double-type.json qapi-schema += double-type.json
qapi-schema += duplicate-key.json qapi-schema += duplicate-key.json
...@@ -445,6 +463,8 @@ qapi-schema += union-optional-branch.json ...@@ -445,6 +463,8 @@ qapi-schema += union-optional-branch.json
qapi-schema += union-unknown.json qapi-schema += union-unknown.json
qapi-schema += unknown-escape.json qapi-schema += unknown-escape.json
qapi-schema += unknown-expr-key.json qapi-schema += unknown-expr-key.json
check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema))
GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \ GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \
......
tests/qapi-schema/alternate-any.json:2: Alternate 'Alt' member 'one' cannot use type 'any' tests/qapi-schema/alternate-any.json:6: Alternate 'Alt' member 'one' cannot use type 'any'
# we do not allow the 'any' type as an alternate branch # we do not allow the 'any' type as an alternate branch
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'data': { 'one': 'any', 'data': { 'one': 'any',
'two': 'int' } } 'two': 'int' } }
tests/qapi-schema/alternate-array.json:5: Member 'two' of alternate 'Alt' cannot be an array tests/qapi-schema/alternate-array.json:12: Member 'two' of alternate 'Alt' cannot be an array
# we do not allow array branches in alternates # we do not allow array branches in alternates
##
# @One:
##
# TODO: should we support this? # TODO: should we support this?
{ 'struct': 'One', { 'struct': 'One',
'data': { 'name': 'str' } } 'data': { 'name': 'str' } }
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'data': { 'one': 'One', 'data': { 'one': 'One',
'two': [ 'int' ] } } 'two': [ 'int' ] } }
tests/qapi-schema/alternate-base.json:4: Unknown key 'base' in alternate 'Alt' tests/qapi-schema/alternate-base.json:11: Unknown key 'base' in alternate 'Alt'
# we reject alternate with base type # we reject alternate with base type
##
# @Base:
##
{ 'struct': 'Base', { 'struct': 'Base',
'data': { 'string': 'str' } } 'data': { 'string': 'str' } }
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'base': 'Base', 'base': 'Base',
'data': { 'number': 'int' } } 'data': { 'number': 'int' } }
tests/qapi-schema/alternate-clash.json:7: 'a_b' (branch of Alt1) collides with 'a-b' (branch of Alt1) tests/qapi-schema/alternate-clash.json:11: 'a_b' (branch of Alt1) collides with 'a-b' (branch of Alt1)
...@@ -4,5 +4,9 @@ ...@@ -4,5 +4,9 @@
# TODO: In the future, if alternates are simplified to not generate # TODO: In the future, if alternates are simplified to not generate
# the implicit Alt1Kind enum, we would still have a collision with the # the implicit Alt1Kind enum, we would still have a collision with the
# resulting C union trying to have two members named 'a_b'. # resulting C union trying to have two members named 'a_b'.
##
# @Alt1:
##
{ 'alternate': 'Alt1', { 'alternate': 'Alt1',
'data': { 'a-b': 'str', 'a_b': 'int' } } 'data': { 'a-b': 'str', 'a_b': 'int' } }
tests/qapi-schema/alternate-conflict-dict.json:6: Alternate 'Alt' member 'two' can't be distinguished from member 'one' tests/qapi-schema/alternate-conflict-dict.json:16: Alternate 'Alt' member 'two' can't be distinguished from member 'one'
# we reject alternates with multiple object branches # we reject alternates with multiple object branches
##
# @One:
##
{ 'struct': 'One', { 'struct': 'One',
'data': { 'name': 'str' } } 'data': { 'name': 'str' } }
##
# @Two:
##
{ 'struct': 'Two', { 'struct': 'Two',
'data': { 'value': 'int' } } 'data': { 'value': 'int' } }
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'data': { 'one': 'One', 'data': { 'one': 'One',
'two': 'Two' } } 'two': 'Two' } }
tests/qapi-schema/alternate-conflict-string.json:4: Alternate 'Alt' member 'two' can't be distinguished from member 'one' tests/qapi-schema/alternate-conflict-string.json:11: Alternate 'Alt' member 'two' can't be distinguished from member 'one'
# we reject alternates with multiple string-like branches # we reject alternates with multiple string-like branches
##
# @Enum:
##
{ 'enum': 'Enum', { 'enum': 'Enum',
'data': [ 'hello', 'world' ] } 'data': [ 'hello', 'world' ] }
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'data': { 'one': 'str', 'data': { 'one': 'str',
'two': 'Enum' } } 'two': 'Enum' } }
tests/qapi-schema/alternate-empty.json:2: Alternate 'Alt' should have at least two branches in 'data' tests/qapi-schema/alternate-empty.json:6: Alternate 'Alt' should have at least two branches in 'data'
# alternates must list at least two types to be useful # alternates must list at least two types to be useful
##
# @Alt:
##
{ 'alternate': 'Alt', 'data': { 'i': 'int' } } { 'alternate': 'Alt', 'data': { 'i': 'int' } }
tests/qapi-schema/alternate-nested.json:4: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' tests/qapi-schema/alternate-nested.json:11: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1'
# we reject a nested alternate branch # we reject a nested alternate branch
##
# @Alt1:
##
{ 'alternate': 'Alt1', { 'alternate': 'Alt1',
'data': { 'name': 'str', 'value': 'int' } } 'data': { 'name': 'str', 'value': 'int' } }
##
# @Alt2:
##
{ 'alternate': 'Alt2', { 'alternate': 'Alt2',
'data': { 'nested': 'Alt1', 'b': 'bool' } } 'data': { 'nested': 'Alt1', 'b': 'bool' } }
tests/qapi-schema/alternate-unknown.json:2: Member 'unknown' of alternate 'Alt' uses unknown type 'MissingType' tests/qapi-schema/alternate-unknown.json:6: Member 'unknown' of alternate 'Alt' uses unknown type 'MissingType'
# we reject an alternate with unknown type in branch # we reject an alternate with unknown type in branch
##
# @Alt:
##
{ 'alternate': 'Alt', { 'alternate': 'Alt',
'data': { 'unknown': 'MissingType', 'i': 'int' } } 'data': { 'unknown': 'MissingType', 'i': 'int' } }
tests/qapi-schema/args-alternate.json:3: 'data' for command 'oops' cannot use alternate type 'Alt' tests/qapi-schema/args-alternate.json:11: 'data' for command 'oops' cannot use alternate type 'Alt'
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册