Convert QAPI doc comments to generate rST instead of texinfo
cover Convert QAPI doc comments to generate rST instead of texinfo
This series switches all our QAPI doc comments over from texinfo format to rST.
The basic approach is somewhat similar to how we deal with kerneldoc and hxtool: we have a custom Sphinx extension which is passed a filename which is the json file it should run the QAPI parser over and generate documentation for. Unlike 'kerneldoc' but somewhat like hxtool, I have chosed to generate documentation by generating a tree of docutils nodes, rather than by generating rST source that is then fed to the rST parser to generate docutils nodes. Individual lumps of doc comment go to the rST parser, but the structured parts we render directly. This makes it easier to get the structure and heading level nesting correct.
Rather than trying to exactly handle all the existing comments I have opted (as Markus suggested) to tweak them where this seemed more sensible than contorting the rST generator to deal with weirdnesses. The principal changes are:
* whitespace is now significant, and multiline definitions must have their second and subsequent lines indented to match the first line
* general rST format markup is permitted, not just the small set of markup the old texinfo generator handled. For most things (notably bulleted and itemized lists) the old format is the same as rST was.
* Specific things that might trip people up:
- instead of *bold* and _italic_ rST has **bold** and *italic*
- lists need a preceding and following blank line
- a lone literal '*' will need to be backslash-escaped to avoid a rST syntax error
* the old leading '|' for example (literal text) blocks is replaced by the standard rST '::' literal block.
* headings and subheadings must now be in a freeform documentation comment of their own
* we support arbitrary levels of sub- and sub-sub-heading, not just a main and sub-heading like the old texinfo generator
* as a special case, @foo is retained and is equivalent to ``foo``
This policy means that most of the patch series is cleanups to the doc comments:
- doc comments missing the ':' after @argument (misrenders in the texi, is a syntax error for rST)
- doc comments with indent that doesn't match the tightened requirements (no effect on the texi, but rST cares)
- some lists needed leading/trailing blank lines adding
- a graph intended to be rendered as ascii-art wasn't correctly marked up as a literal block (misrenders in the texi, syntax error for rST)
- some stray hardcoded tab characters needed changing to spaces
- in a few places parts of a doc comment were in the wrong order resulting in it being rendered into the wrong section by mistake
- a few instances of texinfo `quotes' needed to be changed to rST 'quotes'; similarly _this_ isn't valid rST markup, and in one place a literal * needed backslash-escaping
- numerous places were trying to have lists without using the list markup, which renders as weird run-on sentences
- the two places which define headings in the middle of a doc comment are changed to put the heading definition in the standalone-comment-block that the new generator wants (no change to the texinfo output)
Patch 9 changes 663 lines in 20 files but it is purely a whitespace change (verifiable with 'git show -w'). The other patches are generally smaller and straightforward.
All of these patches except for the "escape a literal '*'" one at the end have either no/minimal effect on the generated texinfo or fix misrenderings.
Moving on to the actual code changes:
* we start by changing the existing parser code to be more careful with leading whitespace: instead of stripping it all, it strips only the amount required for indented multiline definitions, and complains if it finds an unexpected de-indent. The texinfo generator code is updated to do whitespace stripping itself, so there is no change to the generated texi source.
* then we add the new qapidoc Sphinx extension, which is not yet used by anything. This is a 500 line script, all added in one patch. I can split it if people think that would help, but I'm not sure I see a good split point.
* then we can convert the two generated reference documents, one at a time. This is mostly just updating makefile rules and the like.
* after that we can do some minor tweaks to doc comments that would have confused the texinfo parser: changing our two instances of '|'-markup literal blocks to rST '::' literal blocks, and adding some headings to the GA reference so the rST interop manual ToC looks better.
* finally, we can delete the old texinfo machinery and update the markup docs in docs/devel/qapi-code-gen.txt
There are a few things I have left out of this initial series:
* unlike the texinfo, there is no generation of index entries or an index in the HTML docs
* although there are HTML anchors on all the command/object/etc headings, they are not stable but just serial-number based tags like '#qapidoc-35', so not suitable for trying to link to from other parts of the docs
My view is that we can add niceties like this later; the series already seems big enough to me.
You can find the HTML rendered version of the results of this series at:
http://people.linaro.org/~peter.maydell/qdoc-snapshot/interop/qemu-ga-ref.html
http://people.linaro.org/~peter.maydell/qdoc-snapshot/interop/qemu-qmp-ref.html
(look also at
http://people.linaro.org/~peter.maydell/qdoc-snapshot/interop/index.html
if you want to see how the ToC for the interop manual comes out)
The manpages are
http://people.linaro.org/~peter.maydell/qemu-ga-ref.7
http://people.linaro.org/~peter.maydell/qemu-qmp-ref.7
(download and render with 'man -l path/to/foo.7')
For comparison, the old texinfo-to-HTML versions of the docs are:
https://www.qemu.org/docs/master/qemu-ga-ref.html
https://www.qemu.org/docs/master/qemu-qmp-ref.html
The first four patches have already been posted separately and reviewed.
I did at some point while working on this eyeball all the generated documentation against the old versions, but there's an awful lot of it, so I might have missed some minor stuff, and I didn't try to redo that full-eyeball-diff with the absolute final version of the code. So it's possible there are some minor misrenderings lurking, but I don't think so.
thanks
-- PMM
Peter Maydell (29):
configure: Allow user to specify sphinx-build binary
configure: Check that sphinx-build is using Python 3
Makefile: Fix typo in dependency list for interop manpages qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment qga/qapi-schema.json: Fix indent level on doc comments qga/qapi-schema.json: minor format fixups for rST qapi/block-core.json: Use literal block for ascii art
qapi: Use ':' after @argument in doc comments
qapi: Fix indent level on doc comments in json files
qapi: Remove hardcoded tabs
qapi/ui.json: Put input-send-event body text in the right place
qapi: Explicitly put "foo: dropped in n.n" notes into Notes section qapi/ui.json: Avoid `...' texinfo style quoting qapi/block-core.json: Use explicit bulleted lists qapi/ui.json: Use explicit bulleted lists qapi/{block,misc,tmp}.json: Use explicit bulleted lists
qapi: Add blank lines before bulleted lists qapi/migration.json: Replace _this_ with *this* qapi/qapi-schema.json: Put headers in their own doc-comment blocks qapi/machine.json: Escape a literal '*' in doc comment scripts/qapi: Move doc-comment whitespace stripping to doc.py scripts/qapi/parser.py: improve doc comment indent handling docs/sphinx: Add new qapi-doc Sphinx extension docs/interop: Convert qemu-ga-ref to rST
docs/interop: Convert qemu-qmp-ref to rST
qapi: Use rST markup for literal blocks qga/qapi-schema.json: Add some headings
scripts/qapi: Remove texinfo generation support docs/devel/qapi-code-gen.txt: Update to new rST backend conventions
docs/devel/qapi-code-gen.txt | 90 ++- configure | 22 +- Makefile | 58 +- tests/Makefile.include | 15 +- qapi/block-core.json | 1127 ++++++++++++++++---------------- qapi/block.json | 47 +- qapi/char.json | 10 +- qapi/dump.json | 4 +- qapi/introspect.json | 12 +- qapi/job.json | 32 +- qapi/machine-target.json | 18 +- qapi/machine.json | 16 +- qapi/migration.json | 206 +++--- qapi/misc-target.json | 8 +- qapi/misc.json | 138 ++-- qapi/net.json | 26 +- qapi/qapi-schema.json | 18 +- qapi/qdev.json | 10 +- qapi/qom.json | 4 +- qapi/rocker.json | 12 +- qapi/run-state.json | 34 +- qapi/sockets.json | 8 +- qapi/tpm.json | 4 +- qapi/trace.json | 15 +- qapi/transaction.json | 4 +- qapi/ui.json | 119 ++-- qga/qapi-schema.json | 160 ++--- MAINTAINERS | 3 +- docs/conf.py | 16 +- docs/index.html.in | 2 - docs/interop/conf.py | 4 + docs/interop/index.rst | 2 + docs/interop/qemu-ga-ref.rst | 4 + docs/interop/qemu-ga-ref.texi | 80 --- docs/interop/qemu-qmp-ref.rst | 4 + docs/interop/qemu-qmp-ref.texi | 80 --- docs/sphinx/qapidoc.py | 504 ++++++++++++++ scripts/qapi-gen.py | 2 - scripts/qapi/doc.py | 302 --------- scripts/qapi/gen.py | 7 - scripts/qapi/parser.py | 94 ++- 41 files changed, 1726 insertions(+), 1595 deletions(-) create mode 100644 docs/interop/qemu-ga-ref.rst delete mode 100644 docs/interop/qemu-ga-ref.texi create mode 100644 docs/interop/qemu-qmp-ref.rst delete mode 100644 docs/interop/qemu-qmp-ref.texi create mode 100644 docs/sphinx/qapidoc.py delete mode 100644 scripts/qapi/doc.py
Signature · 1 line
2.20.1
PATCH 1/29 configure: Allow user to specify sphinx-build binary
Currently we insist on using 'sphinx-build' from the $PATH; allow the user to specify the binary to use. This will be more useful as we become pickier about the capabilities we require (eg needing a Python 3 sphinx-build).
--- configure | 10 +++++++++- Makefile | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-)
configure +9 -1
@@ -584,6 +584,7 @@ query_pkg_config() { } pkg_config=query_pkg_config sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" +sphinx_build=sphinx-build # If the user hasn't specified ARFLAGS, default to 'rv', just as make does. ARFLAGS="${ARFLAGS-rv}"
@@ -975,6 +976,8 @@ for opt do ;; --python=*) python="$optarg" ;; + --sphinx-build=*) sphinx_build="$optarg" + ;; --gcov=*) gcov_tool="$optarg" ;; --smbd=*) smbd="$optarg"
@@ -1677,6 +1680,7 @@ Advanced options (experts only): --make=MAKE use specified make [$make] --install=INSTALL use specified install [$install] --python=PYTHON use specified python [$python] + --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] --smbd=SMBD use specified smbd [$smbd] --with-git=GIT use specified git [$git] --static enable static build [$static]
@@ -4799,7 +4803,7 @@ has_sphinx_build() { # sphinx-build doesn't exist at all or if it is too old. mkdir -p "$TMPDIR1/sphinx" touch "$TMPDIR1/sphinx/index.rst" - sphinx-build -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1 + $sphinx_build -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1 } # Check if tools are available to build documentation.
@@ -6474,6 +6478,9 @@ echo "QEMU_LDFLAGS $QEMU_LDFLAGS" echo "make $make" echo "install $install" echo "python $python ($python_version)" +if test "$docs" != "no"; then + echo "sphinx-build $sphinx_build" +fi echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" != "no" ; then echo "smbd $smbd"
@@ -7503,6 +7510,7 @@ echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak +echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=$iasl" >> $config_host_mak
Makefile +1 -1
@@ -1024,7 +1024,7 @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \ # Note the use of different doctree for each (manual, builder) tuple; # this works around Sphinx not handling parallel invocation on # a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946 -build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" sphinx-build $(if $(V),,-q) -W -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1") +build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) -W -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1") # We assume all RST files in the manual's directory are used in it manual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst) \ $(wildcard $(SRC_PATH)/docs/$1/*.rst.inc) \
Signature · 1 line
2.20.1
PATCH 2/29 configure: Check that sphinx-build is using Python 3
In reply to Peter MaydellCurrently configure's has_sphinx_build() check simply runs a dummy sphinx-build and either passes or fails. This means that "no sphinx-build at all" and "sphinx-build exists but is too old" are both reported the same way.
Further, we want to assume that all the Python we write is running with at least Python 3.5; configure checks that for our scripts, but Sphinx extensions run with whatever Python version sphinx-build itself is using.
Add a check to our conf.py which makes sphinx-build fail if it would be running our extensions with an old Python, and handle this in configure so we can report failure helpfully to the user. This will mean that configure --enable-docs will fail like this if the sphinx-build provided is not suitable:
Warning: sphinx-build exists but it is either too old or uses too old a Python version
ERROR: User requested feature docs
configure was not able to find it.
Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx
(As usual, the default is to simply not build the docs, as we would if sphinx-build wasn't present at all.)
--- configure | 12 ++++++++++-- docs/conf.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
configure +10 -2
@@ -4808,11 +4808,19 @@ has_sphinx_build() { # Check if tools are available to build documentation. if test "$docs" != "no" ; then - if has makeinfo && has pod2man && has_sphinx_build; then + if has_sphinx_build; then + sphinx_ok=yes + else + sphinx_ok=no + fi + if has makeinfo && has pod2man && test "$sphinx_ok" = "yes"; then docs=yes else if test "$docs" = "yes" ; then - feature_not_found "docs" "Install texinfo, Perl/perl-podlators and python-sphinx" + if has $sphinx_build && test "$sphinx_ok" != "yes"; then + echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2 + fi + feature_not_found "docs" "Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx" fi docs=no fi
docs/conf.py +10 -0
@@ -28,6 +28,16 @@ import os import sys +import sphinx +from sphinx.errors import VersionRequirementError + +# Make Sphinx fail cleanly if using an old Python, rather than obscurely +# failing because some code in one of our extensions doesn't work there. +# Unfortunately this doesn't display very neatly (there's an unavoidable +# Python backtrace) but at least the information gets printed... +if sys.version_info < (3,5): + raise VersionRequirementError( + "QEMU requires a Sphinx that uses Python 3.5 or better\n") # The per-manual conf.py will set qemu_docdir for a single-manual build; # otherwise set it here if this is an entire-manual-set build.
Signature · 1 line
2.20.1
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3
configure
Quoted 37 lines · Peter Maydell
Currently configure's
has_sphinx_build()check simply runs a dummy sphinx-build and either passes or fails. This means that "no sphinx-build at all" and "sphinx-build exists but is too old" are both reported the same way.Further, we want to assume that all the Python we write is running with at least Python 3.5; configure checks that for our scripts, but Sphinx extensions run with whatever Python version sphinx-build itself is using.
Add a check to our
conf.pywhich makes sphinx-build fail if it would be running our extensions with an old Python, and handle this in configure so we can report failure helpfully to the user. This will mean that configure --enable-docs will fail like this if the sphinx-build provided is not suitable:Warning: sphinx-build exists but it is either too old or uses too old a Python version
ERROR: User requested feature docs
configure was not able to find it.
Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx(As usual, the default is to simply not build the docs, as we would if sphinx-build wasn't present at all.)
Signed-off-by Peter Maydell <[email protected]>Reviewed-by Alex Bennée <[email protected]>Reviewed-by Wainer dos Santos Moschetta <[email protected]>--- configure | 12 ++++++++++-- docs/conf.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)configure +0
-0
Any particular reason for having $sphinx_build default to the indeterminate version sphinx-build rather than sphinx-build-3?
It's here:
pkg_config=query_pkg_config
sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}"
sphinx_build=sphinx-build
# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
ARFLAGS="${ARFLAGS-rv}"Quoted 43 lines
configure +10
-2@@ -4808,11 +4808,19 @@ has_sphinx_build() { # Check if tools are available to build documentation. if test "$docs" != "no" ; then - if has makeinfo && has pod2man && has_sphinx_build; then + if has_sphinx_build; then + sphinx_ok=yes + else + sphinx_ok=no + fi + if has makeinfo && has pod2man && test "$sphinx_ok" = "yes"; then docs=yes else if test "$docs" = "yes" ; then - feature_not_found "docs" "Install texinfo, Perl/perl-podlators and python-sphinx" + if has $sphinx_build && test "$sphinx_ok" != "yes"; then + echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2 + fi + feature_not_found "docs" "Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx" fi docs=no fidocs/conf.py +10
-0@@ -28,6 +28,16 @@ import os import sys +import sphinx +from sphinx.errors import VersionRequirementError + +# Make Sphinx fail cleanly if using an old Python, rather than obscurely +# failing because some code in one of our extensions doesn't work there. +# Unfortunately this doesn't display very neatly (there's an unavoidable +# Python backtrace) but at least the information gets printed... +if sys.version_info < (3,5): + raise VersionRequirementError( + "QEMU requires a Sphinx that uses Python 3.5 or better\n") # The per-manual conf.py will set qemu_docdir for a single-manual build; # otherwise set it here if this is an entire-manual-set build.
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3
Quoted 36 lines · Markus Armbruster
Quoted 33 lines · Peter Maydell
Currently configure's
has_sphinx_build()check simply runs a dummy sphinx-build and either passes or fails. This means that "no sphinx-build at all" and "sphinx-build exists but is too old" are both reported the same way.Further, we want to assume that all the Python we write is running with at least Python 3.5; configure checks that for our scripts, but Sphinx extensions run with whatever Python version sphinx-build itself is using.
Add a check to our
conf.pywhich makes sphinx-build fail if it would be running our extensions with an old Python, and handle this in configure so we can report failure helpfully to the user. This will mean that configure --enable-docs will fail like this if the sphinx-build provided is not suitable:Warning: sphinx-build exists but it is either too old or uses too old a Python version
ERROR: User requested feature docs
configure was not able to find it.
Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx(As usual, the default is to simply not build the docs, as we would if sphinx-build wasn't present at all.)
Signed-off-by Peter Maydell <[email protected]>Reviewed-by Alex Bennée <[email protected]>Reviewed-by Wainer dos Santos Moschetta <[email protected]>--- configure | 12 ++++++++++-- docs/conf.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
Quoted 7 lines
configure
Quoted 4 lines
configure +0
-0Any particular reason for having $sphinx_build default to the indeterminate version sphinx-build rather than sphinx-build-3?
Because that's the binary we were using before this patch. "Allow the user to specify" shouldn't be tangled up with "and also change the default".
It might be sphinx-build-3 on RH, but on Debian/Ubuntu it's just 'sphinx-build' assuming you installed the python3-sphinx and not the python2-sphinx, or you can run it directly out of /usr/share/sphinx/scripts/python3/sphinx-build, or (like me) you might have a locally installed 'sphinx-build' which is using Python 3. My assumption is that once the python2->3 transition has faded into the rear view mirror most distros will just have a /usr/bin/sphinx-build that's a Python 3 one.
thanks
-- PMM
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3
Quoted 49 lines · Peter Maydell
Quoted 36 lines · Markus Armbruster
Quoted 33 lines · Peter Maydell
Currently configure's
has_sphinx_build()check simply runs a dummy sphinx-build and either passes or fails. This means that "no sphinx-build at all" and "sphinx-build exists but is too old" are both reported the same way.Further, we want to assume that all the Python we write is running with at least Python 3.5; configure checks that for our scripts, but Sphinx extensions run with whatever Python version sphinx-build itself is using.
Add a check to our
conf.pywhich makes sphinx-build fail if it would be running our extensions with an old Python, and handle this in configure so we can report failure helpfully to the user. This will mean that configure --enable-docs will fail like this if the sphinx-build provided is not suitable:Warning: sphinx-build exists but it is either too old or uses too old a Python version
ERROR: User requested feature docs
configure was not able to find it.
Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx(As usual, the default is to simply not build the docs, as we would if sphinx-build wasn't present at all.)
Signed-off-by Peter Maydell <[email protected]>Reviewed-by Alex Bennée <[email protected]>Reviewed-by Wainer dos Santos Moschetta <[email protected]>--- configure | 12 ++++++++++-- docs/conf.py | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)Quoted 7 lines
configure
Quoted 4 lines
configure +0
-0Any particular reason for having $sphinx_build default to the indeterminate version sphinx-build rather than sphinx-build-3?
Because that's the binary we were using before this patch. "Allow the user to specify" shouldn't be tangled up with "and also change the default".
Quoted 8 lines
It might be sphinx-build-3 on RH, but on Debian/Ubuntu it's just 'sphinx-build' assuming you installed the python3-sphinx and not the python2-sphinx, or you can run it directly out of
/usr/share/sphinx/scripts/python3/sphinx-build, or (like me) you might have a locally installed 'sphinx-build' which is using Python 3. My assumption is that once the python2->3 transition has faded into the rear view mirror most distros will just have a/usr/bin/sphinx-buildthat's a Python 3 one.
Defaulting to sphinx-build-3 if it exists, else sphinx-build would be nicer for users on some common systems, and wouldn't hurt users on the other common systems. It's what we do for Python.
Re: [PATCH 02/29] configure: Check that sphinx-build is using Python 3
Quoted 10 lines · Markus Armbruster
Quoted 8 lines · Peter Maydell
It might be sphinx-build-3 on RH, but on Debian/Ubuntu it's just 'sphinx-build' assuming you installed the python3-sphinx and not the python2-sphinx, or you can run it directly out of
/usr/share/sphinx/scripts/python3/sphinx-build, or (like me) you might have a locally installed 'sphinx-build' which is using Python 3. My assumption is that once the python2->3 transition has faded into the rear view mirror most distros will just have a/usr/bin/sphinx-buildthat's a Python 3 one.
Quoted 3 lines
Defaulting to sphinx-build-3 if it exists, else sphinx-build would be nicer for users on some common systems, and wouldn't hurt users on the other common systems. It's what we do for Python.
Feel free to send a followup patch :-) I have no systems where there is a 'sphinx-build-3' at all.
thanks
-- PMM
PATCH 3/29 Makefile: Fix typo in dependency list for interop manpages
In reply to Peter MaydellFix a typo in the dependency list for the manpages built from the 'interop' manual, which meant we were accidentally not including the .hx file in the dependency list.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -1052,7 +1052,7 @@ $(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) $(call define-manpage-rule,interop,\ qemu-ga.8 qemu-img.1 qemu-nbd.8 qemu-trace-stap.1 virtfs-proxy-helper.1,\ - $(SRC_PATH/qemu-img-cmds.hx)) + $(SRC_PATH)/qemu-img-cmds.hx) $(call define-manpage-rule,system,qemu-block-drivers.7)
Signature · 1 line
2.20.1
PATCH 4/29 qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment
In reply to Peter MaydellThe doc comment for GuestDiskBusType doesn't match up with the enumeration because of a missing hyphen in 'file-backed-virtual'. This means the docs are rendered wrongly:
"virtual"
Win virtual bus type "file-backed" virtual: Win file-backed bus type
"file-backed-virtual"
Not documented
Add the missing hyphen.
--- qga/qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qga/qapi-schema.json +1 -1
@@ -809,7 +809,7 @@ # @sas: Win serial-attaches SCSI bus type # @mmc: Win multimedia card (MMC) bus type # @virtual: Win virtual bus type -# @file-backed virtual: Win file-backed bus type +# @file-backed-virtual: Win file-backed bus type # # Since: 2.2; 'Unknown' and all entries below since 2.4 ##
Signature · 1 line
2.20.1
Re: [PATCH 04/29] qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment
Quoted 5 lines · Peter Maydell
The doc comment for GuestDiskBusType doesn't match up with the enumeration because of a missing hyphen in 'file-backed-virtual'. This means the docs are rendered wrongly:
"virtual"
Win virtual bus type "file-backed" virtual: Win file-backed bus type
I expected a funny rendering, but not this one. The doc generator is full of surprises...
Quoted 16 lines
"file-backed-virtual"
Not documented
Add the missing hyphen.Signed-off-by Peter Maydell <[email protected]>Reviewed-by Eric Blake <[email protected]>--- qga/qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)qga/qapi-schema.json +0
-0
qga/qapi-schema.json line 815
Quoted 8 lines
qga/qapi-schema.json +1
-1@@ -809,7 +809,7 @@ # @sas: Win serial-attaches SCSI bus type # @mmc: Win multimedia card (MMC) bus type # @virtual: Win virtual bus type -# @file-backed virtual: Win file-backed bus type +# @file-backed-virtual: Win file-backed bus type # # Since: 2.2; 'Unknown' and all entries below since 2.4 ##
PATCH 5/29 qga/qapi-schema.json: Fix indent level on doc comments
In reply to Peter MaydellThe texinfo doc generation doesn't care much about indentation levels, but we would like to add a rST backend, and rST does care about indentation.
Make the doc comments more strongly consistent about indentation for multiline constructs like:
@arg: description line 1
description line 2
Returns: line one
line 2
so that there is always exactly one space after the colon, and subsequent lines align with the first.
This commit is a purely whitespace change, and it does not alter the generated .texi files (because the texi generation code strips away all the extra whitespace). This does mean that we end up with some over-length lines.
Note that when the documentation for an argument fits on a single line like this:
@arg: one line only
then stray extra spaces after the ':' don't affect the rST output, so I have not attempted to methodically fix them, though the preference is a single space here too.
--- qga/qapi-schema.json | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-)
qga/qapi-schema.json +31 -31
@@ -416,7 +416,7 @@ # Returns: GuestFsfreezeStatus ("thawed", "frozen", etc., as defined below) # # Note: This may fail to properly report the current state as a result of -# some other guest processes having issued an fs freeze/thaw. +# some other guest processes having issued an fs freeze/thaw. # # Since: 0.15.0 ##
@@ -431,13 +431,13 @@ # unfreeze. # # Note: On Windows, the command is implemented with the help of a -# Volume Shadow-copy Service DLL helper. The frozen state is limited -# for up to 10 seconds by VSS. +# Volume Shadow-copy Service DLL helper. The frozen state is limited +# for up to 10 seconds by VSS. # # Returns: Number of file systems currently frozen. On error, all filesystems -# will be thawed. If no filesystems are frozen as a result of this call, -# then @guest-fsfreeze-status will remain "thawed" and calling -# @guest-fsfreeze-thaw is not necessary. +# will be thawed. If no filesystems are frozen as a result of this call, +# then @guest-fsfreeze-status will remain "thawed" and calling +# @guest-fsfreeze-thaw is not necessary. # # Since: 0.15.0 ##
@@ -455,7 +455,7 @@ # Invalid mount points are ignored. # # Returns: Number of file systems currently frozen. On error, all filesystems -# will be thawed. +# will be thawed. # # Since: 2.2 ##
@@ -511,12 +511,12 @@ # Discard (or "trim") blocks which are not in use by the filesystem. # # @minimum: -# Minimum contiguous free range to discard, in bytes. Free ranges -# smaller than this may be ignored (this is a hint and the guest -# may not respect it). By increasing this value, the fstrim -# operation will complete more quickly for filesystems with badly -# fragmented free space, although not all blocks will be discarded. -# The default value is zero, meaning "discard every free block". +# Minimum contiguous free range to discard, in bytes. Free ranges +# smaller than this may be ignored (this is a hint and the guest +# may not respect it). By increasing this value, the fstrim +# operation will complete more quickly for filesystems with badly +# fragmented free space, although not all blocks will be discarded. +# The default value is zero, meaning "discard every free block". # # Returns: A @GuestFilesystemTrimResponse which contains the # status of all trimmed paths. (since 2.4)
@@ -693,7 +693,7 @@ # @ip-addresses: List of addresses assigned to @name # # @statistics: various statistic counters related to @name -# (since 2.11) +# (since 2.11) # # Since: 1.1 ##
@@ -743,7 +743,7 @@ # This is a read-only operation. # # Returns: The list of all VCPUs the guest knows about. Each VCPU is put on the -# list exactly once, but their order is unspecified. +# list exactly once, but their order is unspecified. # # Since: 1.5 ##
@@ -937,8 +937,8 @@ # This is a read-only operation. # # Returns: The list of all memory blocks the guest knows about. -# Each memory block is put on the list exactly once, but their order -# is unspecified. +# Each memory block is put on the list exactly once, but their order +# is unspecified. # # Since: 2.3 ##
@@ -971,9 +971,9 @@ # @response: the result of memory block operation. # # @error-code: the error number. -# When memory block operation fails, we assign the value of -# 'errno' to this member, it indicates what goes wrong. -# When the operation succeeds, it will be omitted. +# When memory block operation fails, we assign the value of +# 'errno' to this member, it indicates what goes wrong. +# When the operation succeeds, it will be omitted. # # Since: 2.3 ##
@@ -1040,15 +1040,15 @@ # @exited: true if process has already terminated. # @exitcode: process exit code if it was normally terminated. # @signal: signal number (linux) or unhandled exception code -# (windows) if the process was abnormally terminated. +# (windows) if the process was abnormally terminated. # @out-data: base64-encoded stdout of the process # @err-data: base64-encoded stderr of the process -# Note: @out-data and @err-data are present only -# if 'capture-output' was specified for 'guest-exec' +# Note: @out-data and @err-data are present only +# if 'capture-output' was specified for 'guest-exec' # @out-truncated: true if stdout was not fully captured -# due to size limitation. +# due to size limitation. # @err-truncated: true if stderr was not fully captured -# due to size limitation. +# due to size limitation. # # Since: 2.5 ##
@@ -1131,8 +1131,8 @@ ## # @GuestUser: -# @user: Username -# @domain: Logon domain (windows only) +# @user: Username +# @domain: Logon domain (windows only) # @login-time: Time of login of this user on the computer. If multiple # instances of the user are logged in, the earliest login time is # reported. The value is in fractional seconds since epoch time.
@@ -1156,10 +1156,10 @@ ## # @GuestTimezone: # -# @zone: Timezone name. These values may differ depending on guest/OS and -# should only be used for informational purposes. -# @offset: Offset to UTC in seconds, negative numbers for time zones west of -# GMT, positive numbers for east +# @zone: Timezone name. These values may differ depending on guest/OS and +# should only be used for informational purposes. +# @offset: Offset to UTC in seconds, negative numbers for time zones west of +# GMT, positive numbers for east # # Since: 2.10 ##
Signature · 1 line
2.20.1
Re: [PATCH 05/29] qga/qapi-schema.json: Fix indent level on doc comments
Quoted 24 lines · Peter Maydell
The texinfo doc generation doesn't care much about indentation levels, but we would like to add a rST backend, and rST does care about indentation.
Make the doc comments more strongly consistent about indentation for multiline constructs like:
@arg: description line 1
description line 2Returns: line one
line 2so that there is always exactly one space after the colon, and subsequent lines align with the first.
This commit is a purely whitespace change, and it does not alter the generated .texi files (because the texi generation code strips away all the extra whitespace). This does mean that we end up with some over-length lines.
Note that when the documentation for an argument fits on a single line like this:
Quoted 7 lines
@arg: one line only
then stray extra spaces after the ':' don't affect the rST output, so I have not attempted to methodically fix them, though the preference is a single space here too.
Signed-off-by Peter Maydell <[email protected]>
How is this commit related to PATCH 9? The commit messages are suspiciously similar...
Markus Armbruster
Reviewed-byRe: [PATCH 05/29] qga/qapi-schema.json: Fix indent level on doc comments
Quoted 28 lines · Markus Armbruster
Quoted 26 lines · Peter Maydell
The texinfo doc generation doesn't care much about indentation levels, but we would like to add a rST backend, and rST does care about indentation.
Make the doc comments more strongly consistent about indentation for multiline constructs like:
@arg: description line 1
description line 2Returns: line one
line 2so that there is always exactly one space after the colon, and subsequent lines align with the first.
This commit is a purely whitespace change, and it does not alter the generated .texi files (because the texi generation code strips away all the extra whitespace). This does mean that we end up with some over-length lines.
Note that when the documentation for an argument fits on a single line like this:
@arg: one line only
Quoted 8 lines
Quoted 5 lines
then stray extra spaces after the ':' don't affect the rST output, so I have not attempted to methodically fix them, though the preference is a single space here too.
Signed-off-by Peter Maydell <[email protected]>How is this commit related to PATCH 9? The commit messages are suspiciously similar...
Nevermind, I got it: this one's for qga/, PATCH 9 if for qapi/.
PATCH 6/29 qga/qapi-schema.json: minor format fixups for rST
In reply to Peter MaydellrST format requires a blank line before the start of a bulleted or enumerated list. Two places in qapi-schema.json were missing this blank line.
Some places were using an indented line as a sort of single-item bulleted list, which in the texinfo output comes out all run onto a single line; use a real bulleted list instead.
Some places unnecessarily indented lists, which confuses rST.
guest-fstrim:minimum's documentation was indented the right amount to share a line with @minimum, but wasn't actually doing so.
The indent on the bulleted list in the guest-set-vcpus Returns section meant rST misindented it.
Changes to the generated texinfo are very minor (the new bulletted lists, and a few extra blank lines).
--- qga/qapi-schema.json | 86 +++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 41 deletions(-)
qga/qapi-schema.json +45 -41
@@ -510,8 +510,7 @@ # # Discard (or "trim") blocks which are not in use by the filesystem. # -# @minimum: -# Minimum contiguous free range to discard, in bytes. Free ranges +# @minimum: Minimum contiguous free range to discard, in bytes. Free ranges # smaller than this may be ignored (this is a hint and the guest # may not respect it). By increasing this value, the fstrim # operation will complete more quickly for filesystems with badly
@@ -546,7 +545,8 @@ # (or set its status to "shutdown") due to other reasons. # # The following errors may be returned: -# If suspend to disk is not supported, Unsupported +# +# - If suspend to disk is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes
@@ -575,12 +575,14 @@ # # This command does NOT return a response on success. There are two options # to check for success: -# 1. Wait for the SUSPEND QMP event from QEMU -# 2. Issue the query-status QMP command to confirm the VM status is -# "suspended" +# +# 1. Wait for the SUSPEND QMP event from QEMU +# 2. Issue the query-status QMP command to confirm the VM status is +# "suspended" # # The following errors may be returned: -# If suspend to ram is not supported, Unsupported +# +# - If suspend to ram is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes
@@ -607,12 +609,14 @@ # # This command does NOT return a response on success. There are two options # to check for success: -# 1. Wait for the SUSPEND QMP event from QEMU -# 2. Issue the query-status QMP command to confirm the VM status is -# "suspended" +# +# 1. Wait for the SUSPEND QMP event from QEMU +# 2. Issue the query-status QMP command to confirm the VM status is +# "suspended" # # The following errors may be returned: -# If hybrid suspend is not supported, Unsupported +# +# - If hybrid suspend is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes
@@ -767,17 +771,17 @@ # Returns: The length of the initial sublist that has been successfully # processed. The guest agent maximizes this value. Possible cases: # -# - 0: if the @vcpus list was empty on input. Guest state -# has not been changed. Otherwise, -# - Error: processing the first node of @vcpus failed for the -# reason returned. Guest state has not been changed. -# Otherwise, +# - 0: if the @vcpus list was empty on input. Guest state +# has not been changed. Otherwise, +# - Error: processing the first node of @vcpus failed for the +# reason returned. Guest state has not been changed. +# Otherwise, # - < length(@vcpus): more than zero initial nodes have been processed, -# but not the entire @vcpus list. Guest state has -# changed accordingly. To retrieve the error -# (assuming it persists), repeat the call with the -# successfully processed initial sublist removed. -# Otherwise, +# but not the entire @vcpus list. Guest state has +# changed accordingly. To retrieve the error +# (assuming it persists), repeat the call with the +# successfully processed initial sublist removed. +# Otherwise, # - length(@vcpus): call successful. # # Since: 1.5
@@ -1182,35 +1186,35 @@ # @GuestOSInfo: # # @kernel-release: -# * POSIX: release field returned by uname(2) -# * Windows: build number of the OS +# * POSIX: release field returned by uname(2) +# * Windows: build number of the OS # @kernel-version: -# * POSIX: version field returned by uname(2) -# * Windows: version number of the OS +# * POSIX: version field returned by uname(2) +# * Windows: version number of the OS # @machine: -# * POSIX: machine field returned by uname(2) -# * Windows: one of x86, x86_64, arm, ia64 +# * POSIX: machine field returned by uname(2) +# * Windows: one of x86, x86_64, arm, ia64 # @id: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "mswindows" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "mswindows" # @name: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "Microsoft Windows" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "Microsoft Windows" # @pretty-name: -# * POSIX: as defined by os-release(5) -# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" +# * POSIX: as defined by os-release(5) +# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" # @version: -# * POSIX: as defined by os-release(5) -# * Windows: long version string, e.g. "Microsoft Windows Server 2008" +# * POSIX: as defined by os-release(5) +# * Windows: long version string, e.g. "Microsoft Windows Server 2008" # @version-id: -# * POSIX: as defined by os-release(5) -# * Windows: short version identifier, e.g. "7" or "20012r2" +# * POSIX: as defined by os-release(5) +# * Windows: short version identifier, e.g. "7" or "20012r2" # @variant: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "server" or "client" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "server" or "client" # @variant-id: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "server" or "client" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "server" or "client" # # Notes: #
Signature · 1 line
2.20.1
Re: [PATCH 06/29] qga/qapi-schema.json: minor format fixups for rST
Quoted 103 lines · Peter Maydell
rST format requires a blank line before the start of a bulleted or enumerated list. Two places in qapi-schema.json were missing this blank line.
Some places were using an indented line as a sort of single-item bulleted list, which in the texinfo output comes out all run onto a single line; use a real bulleted list instead.
Some places unnecessarily indented lists, which confuses rST.
guest-fstrim:minimum's documentation was indented the right amount to share a line with @minimum, but wasn't actually doing so.
The indent on the bulleted list in the guest-set-vcpus Returns section meant rST misindented it.
Changes to the generated texinfo are very minor (the new bulletted lists, and a few extra blank lines).
Signed-off-by Peter Maydell <[email protected]>--- qga/qapi-schema.json | 86 +++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 41 deletions(-)qga/qapi-schema.json +20
-17@@ -510,8 +510,7 @@ # # Discard (or "trim") blocks which are not in use by the filesystem. # -# @minimum: -# Minimum contiguous free range to discard, in bytes. Free ranges +# @minimum: Minimum contiguous free range to discard, in bytes. Free ranges # smaller than this may be ignored (this is a hint and the guest # may not respect it). By increasing this value, the fstrim # operation will complete more quickly for filesystems with badly@@ -546,7 +545,8 @@ # (or set its status to "shutdown") due to other reasons. # # The following errors may be returned: -# If suspend to disk is not supported, Unsupported +# +# - If suspend to disk is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes@@ -575,12 +575,14 @@ # # This command does NOT return a response on success. There are two options # to check for success: -# 1. Wait for the SUSPEND QMP event from QEMU -# 2. Issue the query-status QMP command to confirm the VM status is -# "suspended" +# +# 1. Wait for the SUSPEND QMP event from QEMU +# 2. Issue the query-status QMP command to confirm the VM status is +# "suspended" # # The following errors may be returned: -# If suspend to ram is not supported, Unsupported +# +# - If suspend to ram is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes@@ -607,12 +609,14 @@ # # This command does NOT return a response on success. There are two options # to check for success: -# 1. Wait for the SUSPEND QMP event from QEMU -# 2. Issue the query-status QMP command to confirm the VM status is -# "suspended" +# +# 1. Wait for the SUSPEND QMP event from QEMU +# 2. Issue the query-status QMP command to confirm the VM status is +# "suspended" # # The following errors may be returned: -# If hybrid suspend is not supported, Unsupported +# +# - If hybrid suspend is not supported, Unsupported # # Notes: It's strongly recommended to issue the guest-sync command before # sending commands when the guest resumes@@ -767,17 +771,17 @@ # Returns: The length of the initial sublist that has been successfully # processed. The guest agent maximizes this value. Possible cases: # -# - 0: if the @vcpus list was empty on input. Guest state -# has not been changed. Otherwise, -# - Error: processing the first node of @vcpus failed for the -# reason returned. Guest state has not been changed. -# Otherwise, +# - 0: if the @vcpus list was empty on input. Guest state +# has not been changed. Otherwise, +# - Error: processing the first node of @vcpus failed for the +# reason returned. Guest state has not been changed. +# Otherwise, # - < length(@vcpus): more than zero initial nodes have been processed, -# but not the entire @vcpus list. Guest state has
qga/qapi-schema.json line 785
Quoted 10 lines
qga/qapi-schema.json +5
-4-# changed accordingly. To retrieve the error -# (assuming it persists), repeat the call with the -# successfully processed initial sublist removed. -# Otherwise, +# but not the entire @vcpus list. Guest state has +# changed accordingly. To retrieve the error +# (assuming it persists), repeat the call with the +# successfully processed initial sublist removed. +# Otherwise, # - length(@vcpus): call successful.
Source readability suffers a bit here.
Can we break the line after the colon?
# - 0:
# if the @vcpus list was empty on input. Guest state has
# not been changed. Otherwise,
Or would a definition list be a better fit?
Quoted 48 lines
qga/qapi-schema.json +16
-18# # Since: 1.5@@ -1182,35 +1186,35 @@ # @GuestOSInfo: # # @kernel-release: -# * POSIX: release field returned by uname(2) -# * Windows: build number of the OS +# * POSIX: release field returned by uname(2) +# * Windows: build number of the OS # @kernel-version: -# * POSIX: version field returned by uname(2) -# * Windows: version number of the OS +# * POSIX: version field returned by uname(2) +# * Windows: version number of the OS # @machine: -# * POSIX: machine field returned by uname(2) -# * Windows: one of x86, x86_64, arm, ia64 +# * POSIX: machine field returned by uname(2) +# * Windows: one of x86, x86_64, arm, ia64 # @id: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "mswindows" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "mswindows" # @name: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "Microsoft Windows" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "Microsoft Windows" # @pretty-name: -# * POSIX: as defined by os-release(5) -# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" +# * POSIX: as defined by os-release(5) +# * Windows: product name, e.g. "Microsoft Windows 10 Enterprise" # @version: -# * POSIX: as defined by os-release(5) -# * Windows: long version string, e.g. "Microsoft Windows Server 2008" +# * POSIX: as defined by os-release(5) +# * Windows: long version string, e.g. "Microsoft Windows Server 2008" # @version-id: -# * POSIX: as defined by os-release(5) -# * Windows: short version identifier, e.g. "7" or "20012r2" +# * POSIX: as defined by os-release(5) +# * Windows: short version identifier, e.g. "7" or "20012r2" # @variant: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "server" or "client"
qga/qapi-schema.json line 1220
Quoted 10 lines
qga/qapi-schema.json +4
-2+# * POSIX: as defined by os-release(5) +# * Windows: contains string "server" or "client" # @variant-id: -# * POSIX: as defined by os-release(5) -# * Windows: contains string "server" or "client" +# * POSIX: as defined by os-release(5) +# * Windows: contains string "server" or "client" # # Notes: #
The use of bullets vs. dashes for lists seems a bit random, but that's not this patch's fault.
Re: [PATCH 06/29] qga/qapi-schema.json: minor format fixups for rST
Quoted 54 lines · Markus Armbruster
Quoted 38 lines · Peter Maydell
rST format requires a blank line before the start of a bulleted or enumerated list. Two places in qapi-schema.json were missing this blank line.
Some places were using an indented line as a sort of single-item bulleted list, which in the texinfo output comes out all run onto a single line; use a real bulleted list instead.
Some places unnecessarily indented lists, which confuses rST.
guest-fstrim:minimum's documentation was indented the right amount to share a line with @minimum, but wasn't actually doing so.
The indent on the bulleted list in the guest-set-vcpus Returns section meant rST misindented it.
Changes to the generated texinfo are very minor (the new bulletted lists, and a few extra blank lines).
Signed-off-by Peter Maydell <[email protected]>qga/qapi-schema.json +5
-6@@ -767,17 +771,17 @@ # Returns: The length of the initial sublist that has been successfully # processed. The guest agent maximizes this value. Possible cases: # -# - 0: if the @vcpus list was empty on input. Guest state -# has not been changed. Otherwise, -# - Error: processing the first node of @vcpus failed for the -# reason returned. Guest state has not been changed. -# Otherwise, +# - 0: if the @vcpus list was empty on input. Guest state +# has not been changed. Otherwise, +# - Error: processing the first node of @vcpus failed for the +# reason returned. Guest state has not been changed. +# Otherwise, # - < length(@vcpus): more than zero initial nodes have been processed, -# but not the entire @vcpus list. Guest state hasqga/qapi-schema.json line 785
Quoted 10 lines
qga/qapi-schema.json +5
-4-# changed accordingly. To retrieve the error -# (assuming it persists), repeat the call with the -# successfully processed initial sublist removed. -# Otherwise, +# but not the entire @vcpus list. Guest state has +# changed accordingly. To retrieve the error +# (assuming it persists), repeat the call with the +# successfully processed initial sublist removed. +# Otherwise, # - length(@vcpus): call successful.Source readability suffers a bit here.
Quoted 7 lines
Can we break the line after the colon?
# - 0:
# if the @vcpus list was empty on input. Guest state has
# not been changed. Otherwise,Or would a definition list be a better fit?
A definition list does produce nicer rendering in the rST, but it breaks the rendering in the texinfo (which interprets the indent of a rST definition list as meaninglist and renders it all as one long run-on paragraph). For the purposes of this initial cleanup, I'll put in the newlines you suggest, which have no effect on rendering output for either texinfo or rST.
thanks
-- PMM
Re: [PATCH 06/29] qga/qapi-schema.json: minor format fixups for rST
Quoted 61 lines · Peter Maydell
Quoted 60 lines · Markus Armbruster
Quoted 38 lines · Peter Maydell
rST format requires a blank line before the start of a bulleted or enumerated list. Two places in qapi-schema.json were missing this blank line.
Some places were using an indented line as a sort of single-item bulleted list, which in the texinfo output comes out all run onto a single line; use a real bulleted list instead.
Some places unnecessarily indented lists, which confuses rST.
guest-fstrim:minimum's documentation was indented the right amount to share a line with @minimum, but wasn't actually doing so.
The indent on the bulleted list in the guest-set-vcpus Returns section meant rST misindented it.
Changes to the generated texinfo are very minor (the new bulletted lists, and a few extra blank lines).
Signed-off-by Peter Maydell <[email protected]>qga/qapi-schema.json +5
-6@@ -767,17 +771,17 @@ # Returns: The length of the initial sublist that has been successfully # processed. The guest agent maximizes this value. Possible cases: # -# - 0: if the @vcpus list was empty on input. Guest state -# has not been changed. Otherwise, -# - Error: processing the first node of @vcpus failed for the -# reason returned. Guest state has not been changed. -# Otherwise, +# - 0: if the @vcpus list was empty on input. Guest state +# has not been changed. Otherwise, +# - Error: processing the first node of @vcpus failed for the +# reason returned. Guest state has not been changed. +# Otherwise, # - < length(@vcpus): more than zero initial nodes have been processed, -# but not the entire @vcpus list. Guest state hasqga/qapi-schema.json line 785
Quoted 10 lines
qga/qapi-schema.json +5
-4-# changed accordingly. To retrieve the error -# (assuming it persists), repeat the call with the -# successfully processed initial sublist removed. -# Otherwise, +# but not the entire @vcpus list. Guest state has +# changed accordingly. To retrieve the error +# (assuming it persists), repeat the call with the +# successfully processed initial sublist removed. +# Otherwise, # - length(@vcpus): call successful.Source readability suffers a bit here.
Can we break the line after the colon?
# - 0:
# if the @vcpus list was empty on input. Guest state has
# not been changed. Otherwise,
Quoted 8 lines
Quoted 1 line
Or would a definition list be a better fit?
A definition list does produce nicer rendering in the rST, but it breaks the rendering in the texinfo (which interprets the indent of a rST definition list as meaninglist and renders it all as one long run-on paragraph). For the purposes of this initial cleanup, I'll put in the newlines you suggest, which have no effect on rendering output for either texinfo or rST.
Okay. We can switch to definition lists later.
PATCH 7/29 qapi/block-core.json: Use literal block for ascii art
In reply to Peter MaydellThe ascii-art graph in the BlockLatencyHistogramInfo documentation doesn't render correctly in either the HTML or the manpage output, because in both cases the whitespace is collapsed.
Use the '|' format that emits a literal 'example' block so the graph is displayed correctly.
--- qapi/block-core.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
qapi/block-core.json +7 -7
@@ -550,13 +550,13 @@ # For the example above, @bins may be something like [3, 1, 5, 2], # and corresponding histogram looks like: # -# 5| * -# 4| * -# 3| * * -# 2| * * * -# 1| * * * * -# +------------------ -# 10 50 100 +# | 5| * +# | 4| * +# | 3| * * +# | 2| * * * +# | 1| * * * * +# | +------------------ +# | 10 50 100 # # Since: 4.0 ##
Signature · 1 line
2.20.1
Re: [PATCH 07/29] qapi/block-core.json: Use literal block for ascii art
Quoted 4 lines · Peter Maydell
The ascii-art graph in the BlockLatencyHistogramInfo documentation doesn't render correctly in either the HTML or the manpage output, because in both cases the whitespace is collapsed.
Plain text and PDF output is just as bad. Suggest "doesn't render correctly, because the whitespace is collapsed".
Quoted 20 lines
Use the '|' format that emits a literal 'example' block so the graph is displayed correctly.
Signed-off-by Peter Maydell <[email protected]>--- qapi/block-core.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)qapi/block-core.json +0
-4@@ -550,13 +550,13 @@ # For the example above, @bins may be something like [3, 1, 5, 2], # and corresponding histogram looks like: # -# 5| * -# 4| * -# 3| * * -# 2| * * *
qapi/block-core.json line 559
Quoted 10 lines
qapi/block-core.json +7
-3-# 1| * * * * -# +------------------ -# 10 50 100 +# | 5| * +# | 4| * +# | 3| * * +# | 2| * * * +# | 1| * * * * +# | +------------------ +# | 10 50 100
Wow, we're acquiring a second use of the '|' feature.
It's actually broken, because the doc generator puts each | line in its own @example environment.
Doesn't really matter, because PATCH 26 replaces it by rST markup that actually works. A note in the commit message could make sense, though.
But instead of making it differently broken until PATCH 26 fixes it for good, I'd simply leave it broken until then :)
If you decide to keep the patch: can we keep the table aligned with the preceding paragraph? Like this:
# | 5| * # | 4| * # | 3| * * # | 2| * * * # | 1| * * * * # | +------------------ # | 10 50 100
Quoted 3 lines
qapi/block-core.json +0
-0# # Since: 4.0 ##
Re: [PATCH 07/29] qapi/block-core.json: Use literal block for ascii art
Quoted 44 lines · Markus Armbruster
Quoted 4 lines · Peter Maydell
The ascii-art graph in the BlockLatencyHistogramInfo documentation doesn't render correctly in either the HTML or the manpage output, because in both cases the whitespace is collapsed.
Plain text and PDF output is just as bad. Suggest "doesn't render correctly, because the whitespace is collapsed".
Quoted 20 lines
Use the '|' format that emits a literal 'example' block so the graph is displayed correctly.
Signed-off-by Peter Maydell <[email protected]>--- qapi/block-core.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)qapi/block-core.json +0
-4@@ -550,13 +550,13 @@ # For the example above, @bins may be something like [3, 1, 5, 2], # and corresponding histogram looks like: # -# 5| * -# 4| * -# 3| * * -# 2| * * *qapi/block-core.json line 559
Quoted 10 lines
qapi/block-core.json +7
-3-# 1| * * * * -# +------------------ -# 10 50 100 +# | 5| * +# | 4| * +# | 3| * * +# | 2| * * * +# | 1| * * * * +# | +------------------ +# | 10 50 100Wow, we're acquiring a second use of the '|' feature.
Quoted 8 lines
It's actually broken, because the doc generator puts each | line in its own @example environment.
Doesn't really matter, because PATCH 26 replaces it by rST markup that actually works. A note in the commit message could make sense, though.
But instead of making it differently broken until PATCH 26 fixes it for good, I'd simply leave it broken until then :)
IIRC I need to fix it early, because without the '|' prefix it's a syntax error in rST because of the inconsistent indent. (Otherwise I probably wouldn't have noticed it at all.)
Quoted 14 lines
If you decide to keep the patch: can we keep the table aligned with the preceding paragraph? Like this:
# | 5| * # | 4| * # | 3| * * # | 2| * * * # | 1| * * * * # | +------------------ # | 10 50 100Quoted 3 lines
qapi/block-core.json +0
-0# # Since: 4.0 ##
Sure, why not.
-- PMM
PATCH 8/29 qapi: Use ':' after @argument in doc comments
In reply to Peter MaydellSome qapi doc comments have forgotten the ':' after the @argument, like this:
# @filename Filename for the new image file
# @size Size of the virtual disk in bytes
The result is that these are parsed as part of the body
text and appear as a run-on line:
filename Filename for the new image file size Size of the virtual disk in bytes"
followed by
filename: string
Not documented
size: int
Not documented
in the 'Members' section.
Correct the formatting.
--- qapi/block-core.json | 236 +++++++++++++++++++++---------------------- 1 file changed, 118 insertions(+), 118 deletions(-)
qapi/block-core.json +118 -118
@@ -3235,9 +3235,9 @@ ## # @SshHostKeyCheckMode: # -# @none Don't check the host key at all -# @hash Compare the host key with a given hash -# @known_hosts Check the host key against the known_hosts file +# @none: Don't check the host key at all +# @hash: Compare the host key with a given hash +# @known_hosts: Check the host key against the known_hosts file # # Since: 2.12 ##
@@ -3247,8 +3247,8 @@ ## # @SshHostKeyCheckHashType: # -# @md5 The given hash is an md5 hash -# @sha1 The given hash is an sha1 hash +# @md5: The given hash is an md5 hash +# @sha1: The given hash is an sha1 hash # # Since: 2.12 ##
@@ -3258,8 +3258,8 @@ ## # @SshHostKeyHash: # -# @type The hash algorithm used for the hash -# @hash The expected hash value +# @type: The hash algorithm used for the hash +# @hash: The expected hash value # # Since: 2.12 ##
@@ -4265,13 +4265,13 @@ # # Driver specific image creation options for file. # -# @filename Filename for the new image file -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, -# falloc (if defined CONFIG_POSIX_FALLOCATE), -# full (if defined CONFIG_POSIX)) -# @nocow Turn off copy-on-write (valid only on btrfs; default: off) +# @filename: Filename for the new image file +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_POSIX_FALLOCATE), +# full (if defined CONFIG_POSIX)) +# @nocow: Turn off copy-on-write (valid only on btrfs; default: off) # # Since: 2.12 ##
@@ -4286,12 +4286,12 @@ # # Driver specific image creation options for gluster. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, -# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE), -# full (if defined CONFIG_GLUSTERFS_ZEROFILL)) +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE), +# full (if defined CONFIG_GLUSTERFS_ZEROFILL)) # # Since: 2.12 ##
@@ -4305,11 +4305,11 @@ # # Driver specific image creation options for LUKS. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image -# (since: 4.2) -# (default: off; allowed values: off, metadata, falloc, full) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image +# (since: 4.2) +# (default: off; allowed values: off, metadata, falloc, full) # # Since: 2.12 ##
@@ -4324,8 +4324,8 @@ # # Driver specific image creation options for NFS. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes # # Since: 2.12 ##
@@ -4338,9 +4338,9 @@ # # Driver specific image creation options for parallels. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @cluster-size Cluster size in bytes (default: 1 MB) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @cluster-size: Cluster size in bytes (default: 1 MB) # # Since: 2.12 ##
@@ -4354,11 +4354,11 @@ # # Driver specific image creation options for qcow. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @backing-file File name of the backing file if a backing file -# should be used -# @encrypt Encryption options if the image should be encrypted +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @backing-file: File name of the backing file if a backing file +# should be used +# @encrypt: Encryption options if the image should be encrypted # # Since: 2.12 ##
@@ -4385,24 +4385,24 @@ # # Driver specific image creation options for qcow2. # -# @file Node to create the image format on -# @data-file Node to use as an external data file in which all guest -# data is stored so that only metadata remains in the qcow2 -# file (since: 4.0) -# @data-file-raw True if the external data file must stay valid as a -# standalone (read-only) raw image without looking at qcow2 -# metadata (default: false; since: 4.0) -# @size Size of the virtual disk in bytes -# @version Compatibility level (default: v3) -# @backing-file File name of the backing file if a backing file -# should be used -# @backing-fmt Name of the block driver to use for the backing file -# @encrypt Encryption options if the image should be encrypted -# @cluster-size qcow2 cluster size in bytes (default: 65536) -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, falloc, full, metadata) -# @lazy-refcounts True if refcounts may be updated lazily (default: off) -# @refcount-bits Width of reference counts in bits (default: 16) +# @file: Node to create the image format on +# @data-file: Node to use as an external data file in which all guest +# data is stored so that only metadata remains in the qcow2 +# file (since: 4.0) +# @data-file-raw: True if the external data file must stay valid as a +# standalone (read-only) raw image without looking at qcow2 +# metadata (default: false; since: 4.0) +# @size: Size of the virtual disk in bytes +# @version: Compatibility level (default: v3) +# @backing-file: File name of the backing file if a backing file +# should be used +# @backing-fmt: Name of the block driver to use for the backing file +# @encrypt: Encryption options if the image should be encrypted +# @cluster-size: qcow2 cluster size in bytes (default: 65536) +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, falloc, full, metadata) +# @lazy-refcounts: True if refcounts may be updated lazily (default: off) +# @refcount-bits: Width of reference counts in bits (default: 16) # # Since: 2.12 ##
@@ -4425,13 +4425,13 @@ # # Driver specific image creation options for qed. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @backing-file File name of the backing file if a backing file -# should be used -# @backing-fmt Name of the block driver to use for the backing file -# @cluster-size Cluster size in bytes (default: 65536) -# @table-size L1/L2 table size (in clusters) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @backing-file: File name of the backing file if a backing file +# should be used +# @backing-fmt: Name of the block driver to use for the backing file +# @cluster-size: Cluster size in bytes (default: 65536) +# @table-size: L1/L2 table size (in clusters) # # Since: 2.12 ##
@@ -4448,10 +4448,10 @@ # # Driver specific image creation options for rbd/Ceph. # -# @location Where to store the new image file. This location cannot -# point to a snapshot. -# @size Size of the virtual disk in bytes -# @cluster-size RBD object size +# @location: Where to store the new image file. This location cannot +# point to a snapshot. +# @size: Size of the virtual disk in bytes +# @cluster-size: RBD object size # # Since: 2.12 ##
@@ -4499,23 +4499,23 @@ # # Driver specific image creation options for VMDK. # -# @file Where to store the new image file. This refers to the image -# file for monolithcSparse and streamOptimized format, or the -# descriptor file for other formats. -# @size Size of the virtual disk in bytes -# @extents Where to store the data extents. Required for monolithcFlat, -# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For -# monolithicFlat, only one entry is required; for -# twoGbMaxExtent* formats, the number of entries required is -# calculated as extent_number = virtual_size / 2GB. Providing -# more extents than will be used is an error. -# @subformat The subformat of the VMDK image. Default: "monolithicSparse". -# @backing-file The path of backing file. Default: no backing file is used. -# @adapter-type The adapter type used to fill in the descriptor. Default: ide. -# @hwversion Hardware version. The meaningful options are "4" or "6". -# Default: "4". -# @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats. -# Default: false. +# @file: Where to store the new image file. This refers to the image +# file for monolithcSparse and streamOptimized format, or the +# descriptor file for other formats. +# @size: Size of the virtual disk in bytes +# @extents: Where to store the data extents. Required for monolithcFlat, +# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For +# monolithicFlat, only one entry is required; for +# twoGbMaxExtent* formats, the number of entries required is +# calculated as extent_number = virtual_size / 2GB. Providing +# more extents than will be used is an error. +# @subformat: The subformat of the VMDK image. Default: "monolithicSparse". +# @backing-file: The path of backing file. Default: no backing file is used. +# @adapter-type: The adapter type used to fill in the descriptor. Default: ide. +# @hwversion: Hardware version. The meaningful options are "4" or "6". +# Default: "4". +# @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats. +# Default: false. # # Since: 4.0 ##
@@ -4533,9 +4533,9 @@ ## # @SheepdogRedundancyType: # -# @full Create a fully replicated vdi with x copies -# @erasure-coded Create an erasure coded vdi with x data strips and -# y parity strips +# @full: Create a fully replicated vdi with x copies +# @erasure-coded: Create an erasure coded vdi with x data strips and +# y parity strips # # Since: 2.12 ##
@@ -4545,7 +4545,7 @@ ## # @SheepdogRedundancyFull: # -# @copies Number of copies to use (between 1 and 31) +# @copies: Number of copies to use (between 1 and 31) # # Since: 2.12 ##
@@ -4555,8 +4555,8 @@ ## # @SheepdogRedundancyErasureCoded: # -# @data-strips Number of data strips to use (one of {2,4,8,16}) -# @parity-strips Number of parity strips to use (between 1 and 15) +# @data-strips: Number of data strips to use (one of {2,4,8,16}) +# @parity-strips: Number of parity strips to use (between 1 and 15) # # Since: 2.12 ##
@@ -4580,13 +4580,13 @@ # # Driver specific image creation options for Sheepdog. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes -# @backing-file File name of a base image -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, full) -# @redundancy Redundancy of the image -# @object-size Object size of the image +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes +# @backing-file: File name of a base image +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, full) +# @redundancy: Redundancy of the image +# @object-size: Object size of the image # # Since: 2.12 ##
@@ -4603,8 +4603,8 @@ # # Driver specific image creation options for SSH. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes # # Since: 2.12 ##
@@ -4617,10 +4617,10 @@ # # Driver specific image creation options for VDI. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, metadata) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, metadata) # # Since: 2.12 ##
@@ -4645,17 +4645,17 @@ # # Driver specific image creation options for vhdx. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @log-size Log size in bytes, must be a multiple of 1 MB -# (default: 1 MB) -# @block-size Block size in bytes, must be a multiple of 1 MB and not -# larger than 256 MB (default: automatically choose a block -# size depending on the image size) -# @subformat vhdx subformat (default: dynamic) -# @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard, -# but default. Do not set to 'off' when using 'qemu-img -# convert' with subformat=dynamic. +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @log-size: Log size in bytes, must be a multiple of 1 MB +# (default: 1 MB) +# @block-size: Block size in bytes, must be a multiple of 1 MB and not +# larger than 256 MB (default: automatically choose a block +# size depending on the image size) +# @subformat: vhdx subformat (default: dynamic) +# @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard, +# but default. Do not set to 'off' when using 'qemu-img +# convert' with subformat=dynamic. # # Since: 2.12 ##
@@ -4683,12 +4683,12 @@ # # Driver specific image creation options for vpc (VHD). # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @subformat vhdx subformat (default: dynamic) -# @force-size Force use of the exact byte size instead of rounding to the -# next size that can be represented in CHS geometry -# (default: false) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @subformat: vhdx subformat (default: dynamic) +# @force-size: Force use of the exact byte size instead of rounding to the +# next size that can be represented in CHS geometry +# (default: false) # # Since: 2.12 ##
@@ -4703,7 +4703,7 @@ # # Options for creating an image format on a given node. # -# @driver block driver to create the image format +# @driver: block driver to create the image format # # Since: 2.12 ##
Signature · 1 line
2.20.1
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Quoted 15 lines · Peter Maydell
Some qapi doc comments have forgotten the ':' after the @argument, like this:
# @filename Filename for the new image file
# @size Size of the virtual disk in bytesThe result is that these are parsed as part of the body
text and appear as a run-on line:
filename Filename for the new image file size Size of the virtual disk in bytes"
followed by
filename: string
Not documented
size: int
Not documented
Quoted 1 line
in the 'Members' section.
Easy error to make, and due to the "anything goes" nature of the doc comment syntax, the QAPI generator won't help you.
Quoted 394 lines
Correct the formatting.
Signed-off-by Peter Maydell <[email protected]>--- qapi/block-core.json | 236 +++++++++++++++++++++---------------------- 1 file changed, 118 insertions(+), 118 deletions(-)qapi/block-core.json +117
-117@@ -3235,9 +3235,9 @@ ## # @SshHostKeyCheckMode: # -# @none Don't check the host key at all -# @hash Compare the host key with a given hash -# @known_hosts Check the host key against the known_hosts file +# @none: Don't check the host key at all +# @hash: Compare the host key with a given hash +# @known_hosts: Check the host key against the known_hosts file # # Since: 2.12 ##@@ -3247,8 +3247,8 @@ ## # @SshHostKeyCheckHashType: # -# @md5 The given hash is an md5 hash -# @sha1 The given hash is an sha1 hash +# @md5: The given hash is an md5 hash +# @sha1: The given hash is an sha1 hash # # Since: 2.12 ##@@ -3258,8 +3258,8 @@ ## # @SshHostKeyHash: # -# @type The hash algorithm used for the hash -# @hash The expected hash value +# @type: The hash algorithm used for the hash +# @hash: The expected hash value # # Since: 2.12 ##@@ -4265,13 +4265,13 @@ # # Driver specific image creation options for file. # -# @filename Filename for the new image file -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, -# falloc (if defined CONFIG_POSIX_FALLOCATE), -# full (if defined CONFIG_POSIX)) -# @nocow Turn off copy-on-write (valid only on btrfs; default: off) +# @filename: Filename for the new image file +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_POSIX_FALLOCATE), +# full (if defined CONFIG_POSIX)) +# @nocow: Turn off copy-on-write (valid only on btrfs; default: off) # # Since: 2.12 ##@@ -4286,12 +4286,12 @@ # # Driver specific image creation options for gluster. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, -# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE), -# full (if defined CONFIG_GLUSTERFS_ZEROFILL)) +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, +# falloc (if defined CONFIG_GLUSTERFS_FALLOCATE), +# full (if defined CONFIG_GLUSTERFS_ZEROFILL)) # # Since: 2.12 ##@@ -4305,11 +4305,11 @@ # # Driver specific image creation options for LUKS. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image -# (since: 4.2) -# (default: off; allowed values: off, metadata, falloc, full) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image +# (since: 4.2) +# (default: off; allowed values: off, metadata, falloc, full) # # Since: 2.12 ##@@ -4324,8 +4324,8 @@ # # Driver specific image creation options for NFS. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes # # Since: 2.12 ##@@ -4338,9 +4338,9 @@ # # Driver specific image creation options for parallels. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @cluster-size Cluster size in bytes (default: 1 MB) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @cluster-size: Cluster size in bytes (default: 1 MB) # # Since: 2.12 ##@@ -4354,11 +4354,11 @@ # # Driver specific image creation options for qcow. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @backing-file File name of the backing file if a backing file -# should be used -# @encrypt Encryption options if the image should be encrypted +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @backing-file: File name of the backing file if a backing file +# should be used +# @encrypt: Encryption options if the image should be encrypted # # Since: 2.12 ##@@ -4385,24 +4385,24 @@ # # Driver specific image creation options for qcow2. # -# @file Node to create the image format on -# @data-file Node to use as an external data file in which all guest -# data is stored so that only metadata remains in the qcow2 -# file (since: 4.0) -# @data-file-raw True if the external data file must stay valid as a -# standalone (read-only) raw image without looking at qcow2 -# metadata (default: false; since: 4.0) -# @size Size of the virtual disk in bytes -# @version Compatibility level (default: v3) -# @backing-file File name of the backing file if a backing file -# should be used -# @backing-fmt Name of the block driver to use for the backing file -# @encrypt Encryption options if the image should be encrypted -# @cluster-size qcow2 cluster size in bytes (default: 65536) -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, falloc, full, metadata) -# @lazy-refcounts True if refcounts may be updated lazily (default: off) -# @refcount-bits Width of reference counts in bits (default: 16) +# @file: Node to create the image format on +# @data-file: Node to use as an external data file in which all guest +# data is stored so that only metadata remains in the qcow2 +# file (since: 4.0) +# @data-file-raw: True if the external data file must stay valid as a +# standalone (read-only) raw image without looking at qcow2 +# metadata (default: false; since: 4.0) +# @size: Size of the virtual disk in bytes +# @version: Compatibility level (default: v3) +# @backing-file: File name of the backing file if a backing file +# should be used +# @backing-fmt: Name of the block driver to use for the backing file +# @encrypt: Encryption options if the image should be encrypted +# @cluster-size: qcow2 cluster size in bytes (default: 65536) +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, falloc, full, metadata) +# @lazy-refcounts: True if refcounts may be updated lazily (default: off) +# @refcount-bits: Width of reference counts in bits (default: 16) # # Since: 2.12 ##@@ -4425,13 +4425,13 @@ # # Driver specific image creation options for qed. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @backing-file File name of the backing file if a backing file -# should be used -# @backing-fmt Name of the block driver to use for the backing file -# @cluster-size Cluster size in bytes (default: 65536) -# @table-size L1/L2 table size (in clusters) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @backing-file: File name of the backing file if a backing file +# should be used +# @backing-fmt: Name of the block driver to use for the backing file +# @cluster-size: Cluster size in bytes (default: 65536) +# @table-size: L1/L2 table size (in clusters) # # Since: 2.12 ##@@ -4448,10 +4448,10 @@ # # Driver specific image creation options for rbd/Ceph. # -# @location Where to store the new image file. This location cannot -# point to a snapshot. -# @size Size of the virtual disk in bytes -# @cluster-size RBD object size +# @location: Where to store the new image file. This location cannot +# point to a snapshot. +# @size: Size of the virtual disk in bytes +# @cluster-size: RBD object size # # Since: 2.12 ##@@ -4499,23 +4499,23 @@ # # Driver specific image creation options for VMDK. # -# @file Where to store the new image file. This refers to the image -# file for monolithcSparse and streamOptimized format, or the -# descriptor file for other formats. -# @size Size of the virtual disk in bytes -# @extents Where to store the data extents. Required for monolithcFlat, -# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For -# monolithicFlat, only one entry is required; for -# twoGbMaxExtent* formats, the number of entries required is -# calculated as extent_number = virtual_size / 2GB. Providing -# more extents than will be used is an error. -# @subformat The subformat of the VMDK image. Default: "monolithicSparse". -# @backing-file The path of backing file. Default: no backing file is used. -# @adapter-type The adapter type used to fill in the descriptor. Default: ide. -# @hwversion Hardware version. The meaningful options are "4" or "6". -# Default: "4". -# @zeroed-grain Whether to enable zeroed-grain feature for sparse subformats. -# Default: false. +# @file: Where to store the new image file. This refers to the image +# file for monolithcSparse and streamOptimized format, or the +# descriptor file for other formats. +# @size: Size of the virtual disk in bytes +# @extents: Where to store the data extents. Required for monolithcFlat, +# twoGbMaxExtentSparse and twoGbMaxExtentFlat formats. For +# monolithicFlat, only one entry is required; for +# twoGbMaxExtent* formats, the number of entries required is +# calculated as extent_number = virtual_size / 2GB. Providing +# more extents than will be used is an error. +# @subformat: The subformat of the VMDK image. Default: "monolithicSparse". +# @backing-file: The path of backing file. Default: no backing file is used. +# @adapter-type: The adapter type used to fill in the descriptor. Default: ide. +# @hwversion: Hardware version. The meaningful options are "4" or "6". +# Default: "4". +# @zeroed-grain: Whether to enable zeroed-grain feature for sparse subformats. +# Default: false. # # Since: 4.0 ##@@ -4533,9 +4533,9 @@ ## # @SheepdogRedundancyType: # -# @full Create a fully replicated vdi with x copies -# @erasure-coded Create an erasure coded vdi with x data strips and -# y parity strips +# @full: Create a fully replicated vdi with x copies +# @erasure-coded: Create an erasure coded vdi with x data strips and +# y parity strips # # Since: 2.12 ##@@ -4545,7 +4545,7 @@ ## # @SheepdogRedundancyFull: # -# @copies Number of copies to use (between 1 and 31) +# @copies: Number of copies to use (between 1 and 31) # # Since: 2.12 ##@@ -4555,8 +4555,8 @@ ## # @SheepdogRedundancyErasureCoded: # -# @data-strips Number of data strips to use (one of {2,4,8,16}) -# @parity-strips Number of parity strips to use (between 1 and 15) +# @data-strips: Number of data strips to use (one of {2,4,8,16}) +# @parity-strips: Number of parity strips to use (between 1 and 15) # # Since: 2.12 ##@@ -4580,13 +4580,13 @@ # # Driver specific image creation options for Sheepdog. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes -# @backing-file File name of a base image -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, full) -# @redundancy Redundancy of the image -# @object-size Object size of the image +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes +# @backing-file: File name of a base image +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, full) +# @redundancy: Redundancy of the image +# @object-size: Object size of the image # # Since: 2.12 ##@@ -4603,8 +4603,8 @@ # # Driver specific image creation options for SSH. # -# @location Where to store the new image file -# @size Size of the virtual disk in bytes +# @location: Where to store the new image file +# @size: Size of the virtual disk in bytes # # Since: 2.12 ##@@ -4617,10 +4617,10 @@ # # Driver specific image creation options for VDI. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @preallocation Preallocation mode for the new image (default: off; -# allowed values: off, metadata) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @preallocation: Preallocation mode for the new image (default: off; +# allowed values: off, metadata) # # Since: 2.12 ##@@ -4645,17 +4645,17 @@ # # Driver specific image creation options for vhdx. # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @log-size Log size in bytes, must be a multiple of 1 MB -# (default: 1 MB) -# @block-size Block size in bytes, must be a multiple of 1 MB and not -# larger than 256 MB (default: automatically choose a block -# size depending on the image size) -# @subformat vhdx subformat (default: dynamic) -# @block-state-zero Force use of payload blocks of type 'ZERO'. Non-standard, -# but default. Do not set to 'off' when using 'qemu-img -# convert' with subformat=dynamic. +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @log-size: Log size in bytes, must be a multiple of 1 MB +# (default: 1 MB) +# @block-size: Block size in bytes, must be a multiple of 1 MB and not +# larger than 256 MB (default: automatically choose a block +# size depending on the image size) +# @subformat: vhdx subformat (default: dynamic) +# @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard, +# but default. Do not set to 'off' when using 'qemu-img +# convert' with subformat=dynamic. # # Since: 2.12 ##@@ -4683,12 +4683,12 @@ # # Driver specific image creation options for vpc (VHD). # -# @file Node to create the image format on -# @size Size of the virtual disk in bytes -# @subformat vhdx subformat (default: dynamic) -# @force-size Force use of the exact byte size instead of rounding to the -# next size that can be represented in CHS geometry -# (default: false) +# @file: Node to create the image format on +# @size: Size of the virtual disk in bytes +# @subformat: vhdx subformat (default: dynamic) +# @force-size: Force use of the exact byte size instead of rounding to the +# next size that can be represented in CHS geometry +# (default: false) # # Since: 2.12 ##
qapi/block-core.json line 4709
Quoted 8 lines
qapi/block-core.json +1
-1@@ -4703,7 +4703,7 @@ # # Options for creating an image format on a given node. # -# @driver block driver to create the image format +# @driver: block driver to create the image format # # Since: 2.12 ##
Loses the visual alignment. I'm okay with that, but the folks who took the trouble to align the text may have different ideas. Cc'ing Kevin and Max.
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
On 07.02.20 10:28, Markus Armbruster wrote:
[...]
Quoted 3 lines
Loses the visual alignment. I'm okay with that, but the folks who took the trouble to align the text may have different ideas. Cc'ing Kevin and Max.
I certainly don’t mind.
Max
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
In reply to Markus ArmbrusterAm 07.02.2020 um 10:28 hat Markus Armbruster geschrieben:
Quoted 14 lines
qapi/block-core.json line 4709
Quoted 9 lines · Peter Maydell
qapi/block-core.json +1
-1@@ -4703,7 +4703,7 @@ # # Options for creating an image format on a given node. # -# @driver block driver to create the image format +# @driver: block driver to create the image format # # Since: 2.12 ##Loses the visual alignment. I'm okay with that, but the folks who took the trouble to align the text may have different ideas. Cc'ing Kevin and Max.
I think the documentation is much easier to parse visually with aligned text as it makes both the option name and the whole part of the comment that documents options stand out clearly.
Of course, "It is the QEMU coding style." would trump everything, but as long as there isn't a style guide that requires a wall of text without spaces and alignment, I'd prefer to leave at least those aligned texts in place that we have.
Kevin
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Quoted 17 lines · Kevin Wolf
Am 07.02.2020 um 10:28 hat Markus Armbruster geschrieben:
Quoted 14 lines
qapi/block-core.json line 4709
Quoted 9 lines · Peter Maydell
qapi/block-core.json +1
-1@@ -4703,7 +4703,7 @@ # # Options for creating an image format on a given node. # -# @driver block driver to create the image format +# @driver: block driver to create the image format # # Since: 2.12 ##Loses the visual alignment. I'm okay with that, but the folks who took the trouble to align the text may have different ideas. Cc'ing Kevin and Max.
Quoted 8 lines
I think the documentation is much easier to parse visually with aligned text as it makes both the option name and the whole part of the comment that documents options stand out clearly.
Of course, "It is the QEMU coding style." would trump everything, but as long as there isn't a style guide that requires a wall of text without spaces and alignment, I'd prefer to leave at least those aligned texts in place that we have.
So, the other way to handle this would be to say "the @foo: can have an arbitrary amount of whitespace after it", and have the doc comment parser strip out that many characters of extra whitespace there and on the subsequent lines. The downside is that then you would have no way of having a comment for an argument which started with rST markup that required leading whitespace. I think this pretty much would just mean that you can't start an argument description with a blockquote, so we don't lose much, but there is a difference currently between:
@arg: In the current parser this is a blockquote
Blockquote line 2
But this is a non-blockquoted line still in @arg's description
and
@arg: This is not blockquoted, it's just a line
So is this
and this
I can make the parser work the other way if people prefer that though (and then the first example above would become a syntax error because the 3rd line would be unexpectedly de-indented).
thanks
-- PMM
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Quoted 43 lines · Peter Maydell
Quoted 17 lines · Kevin Wolf
Am 07.02.2020 um 10:28 hat Markus Armbruster geschrieben:
Quoted 14 lines
qapi/block-core.json line 4709
Quoted 9 lines · Peter Maydell
qapi/block-core.json +1
-1@@ -4703,7 +4703,7 @@ # # Options for creating an image format on a given node. # -# @driver block driver to create the image format +# @driver: block driver to create the image format # # Since: 2.12 ##Loses the visual alignment. I'm okay with that, but the folks who took the trouble to align the text may have different ideas. Cc'ing Kevin and Max.
Quoted 8 lines
I think the documentation is much easier to parse visually with aligned text as it makes both the option name and the whole part of the comment that documents options stand out clearly.
Of course, "It is the QEMU coding style." would trump everything, but as long as there isn't a style guide that requires a wall of text without spaces and alignment, I'd prefer to leave at least those aligned texts in place that we have.
So, the other way to handle this would be to say "the @foo: can have an arbitrary amount of whitespace after it", and have the doc comment parser strip out that many characters of extra whitespace there and on the subsequent lines. The downside is that then you would have no way of having a comment for an argument which started with rST markup that required leading whitespace. I think this pretty much would just mean that you can't start an argument description with a blockquote, so we don't lose much, but there is a difference currently between:
@arg: In the current parser this is a blockquote
Blockquote line 2But this is a non-blockquoted line still in @arg's description
and
Quoted 7 lines
@arg: This is not blockquoted, it's just a line
So is this
and thisI can make the parser work the other way if people prefer that though (and then the first example above would become a syntax error because the 3rd line would be unexpectedly de-indented).
Let me ignore rST details for a bit.
The prevailing schema style looks like this:
# @file: Node to create the image format on
# @size: Size of the virtual disk in bytes
# @log-size: Log size in bytes, must be a multiple of 1 MB
# (default: 1 MB)
# @block-size: Block size in bytes, must be a multiple of 1 MB and not
# larger than 256 MB (default: automatically choose a block
# size depending on the image size)
# @subformat: vhdx subformat (default: dynamic)
# @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
# but default. Do not set to 'off' when using 'qemu-img
# convert' with subformat=dynamic.
Peter's patch converts to it. Can't fault him for converting to the prevailing style.
Trouble is the prevailing style is ugly, and can waste massive amounts of screen real estate when both the identifier and the explaining text are long.
block*.json's style looks like this:
# @file: Node to create the image format on
# @size: Size of the virtual disk in bytes
# @log-size: Log size in bytes, must be a multiple of 1 MB
# (default: 1 MB)
# @block-size: Block size in bytes, must be a multiple of 1 MB and not
# larger than 256 MB (default: automatically choose a block
# size depending on the image size)
# @subformat: vhdx subformat (default: dynamic) # @block-state-zero: Force use of payload blocks of type 'ZERO'. Non-standard,
# but default. Do not set to 'off' when using 'qemu-img
# convert' with subformat=dynamic.
I dislike this style, too. It's less ugly, until you add a longer member. Then you either accept inconsistent indentation, or reindent all the other members. Blech.
Here's a style I'd dislike less:
# @file: Node to create the image format on
#
# @size: Size of the virtual disk in bytes
#
# @log-size: Log size in bytes, must be a multiple of 1 MB
# (default: 1 MB)
#
# @block-size: Block size in bytes, must be a multiple of 1 MB and not
# larger than 256 MB (default: automatically choose a block
# size depending on the image size)
#
# @subformat: vhdx subformat (default: dynamic)
#
# @block-state-zero: Force use of payload blocks of type 'ZERO'.
# Non-standard, but default. Do not set to 'off' when using
# 'qemu-img convert' with subformat=dynamic.
Or maybe even
# @file:
# Node to create the image format on
#
# @size:
# Size of the virtual disk in bytes
#
# @log-size:
# Log size in bytes, must be a multiple of 1 MB (default: 1 MB) #
# @block-size:
# Block size in bytes, must be a multiple of 1 MB and not larger # than 256 MB (default: automatically choose a block size depending # on the image size)
#
# @subformat:
# vhdx subformat (default: dynamic)
#
# @block-state-zero:
# Force use of payload blocks of type 'ZERO'. Non-standard, but # default. Do not set to 'off' when using 'qemu-img convert' with # subformat=dynamic.
With both these styles, member names stand out reasonably well, and I don't have to fiddle with indentation when adding or removing members. With the second one, I don't have to fiddle with indentation at all.
The second one might be the better fit for rST, but that's for Peter to judge.
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
On 07.02.20 15:43, Markus Armbruster wrote:
[...]
Quoted 13 lines
# @file:
# Node to create the image format on
#
# @size:
# Size of the virtual disk in bytes
#
# @log-size:
# Log size in bytes, must be a multiple of 1 MB (default: 1 MB) #
# @block-size:
# Block size in bytes, must be a multiple of 1 MB and not larger # than 256 MB (default: automatically choose a block size depending # on the image size)
Quoted 8 lines
#
# @subformat:
# vhdx subformat (default: dynamic)
#
# @block-state-zero:
# Force use of payload blocks of type 'ZERO'. Non-standard, but # default. Do not set to 'off' when using 'qemu-img convert' with # subformat=dynamic.
FWIW, I like this one.
Max
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Am 07.02.2020 um 16:01 hat Max Reitz geschrieben:
Quoted 26 lines · Markus Armbruster
[...]
Quoted 13 lines
# @file:
# Node to create the image format on
#
# @size:
# Size of the virtual disk in bytes
#
# @log-size:
# Log size in bytes, must be a multiple of 1 MB (default: 1 MB) #
# @block-size:
# Block size in bytes, must be a multiple of 1 MB and not larger # than 256 MB (default: automatically choose a block size depending # on the image size)Quoted 8 lines
#
# @subformat:
# vhdx subformat (default: dynamic)
#
# @block-state-zero:
# Force use of payload blocks of type 'ZERO'. Non-standard, but # default. Do not set to 'off' when using 'qemu-img convert' with # subformat=dynamic.
Quoted 1 line
FWIW, I like this one.
Looks like a workable compromise to me, too.
Kevin
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
In reply to Markus ArmbrusterQuoted 18 lines · Markus Armbruster
Here's a style I'd dislike less:
# @file: Node to create the image format on
#
# @size: Size of the virtual disk in bytes
#
# @log-size: Log size in bytes, must be a multiple of 1 MB
# (default: 1 MB)
#
# @block-size: Block size in bytes, must be a multiple of 1 MB and not
# larger than 256 MB (default: automatically choose a block
# size depending on the image size)
#
# @subformat: vhdx subformat (default: dynamic)
#
# @block-state-zero: Force use of payload blocks of type 'ZERO'.
# Non-standard, but default. Do not set to 'off' when using
# 'qemu-img convert' with subformat=dynamic.
The problem with this one is that there's no way for the doc-comment parser to know how far lines 2,3... are supposed to be indented. Unlike the block-quote issue, this is a real problem, because it's not possible to distinguish:
# @foo: - Here's a bulleted list
# Line 2 of the list item should indent to match the first
# @bar: - A one item list
# A line not in the list
which is the kind of thing that will show up in real-world usage. (Unless you wanted to say "always 4-space indent" or something, which I think would tend to result in a lot of accidental over-indentation and unintended blockquotes in the output.)
Quoted 15 lines
Or maybe even
# @file:
# Node to create the image format on
#
# @size:
# Size of the virtual disk in bytes
#
# @log-size:
# Log size in bytes, must be a multiple of 1 MB (default: 1 MB) #
# @block-size:
# Block size in bytes, must be a multiple of 1 MB and not larger # than 256 MB (default: automatically choose a block size depending # on the image size)
Quoted 8 lines
#
# @subformat:
# vhdx subformat (default: dynamic)
#
# @block-state-zero:
# Force use of payload blocks of type 'ZERO'. Non-standard, but # default. Do not set to 'off' when using 'qemu-img convert' with # subformat=dynamic.
Conveniently this patchset already supports this format :-) You can write either
# @foo: bar
# baz
# indented
or
# @foo:
# bar # baz # indented
and they'll come out to the same thing (the parser.py code sends the same doc strings to the rST visitor).
thanks
-- PMM
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Quoted 4 lines · Peter Maydell
Quoted 1 line · Markus Armbruster
Here's a style I'd dislike less:
[...]
Quoted 29 lines
Quoted 13 lines
# @file:
# Node to create the image format on
#
# @size:
# Size of the virtual disk in bytes
#
# @log-size:
# Log size in bytes, must be a multiple of 1 MB (default: 1 MB) #
# @block-size:
# Block size in bytes, must be a multiple of 1 MB and not larger # than 256 MB (default: automatically choose a block size depending # on the image size)Quoted 8 lines
#
# @subformat:
# vhdx subformat (default: dynamic)
#
# @block-state-zero:
# Force use of payload blocks of type 'ZERO'. Non-standard, but # default. Do not set to 'off' when using 'qemu-img convert' with # subformat=dynamic.Conveniently this patchset already supports this format :-) You can write either
# @foo: bar
# baz
# indented
Quoted 8 lines
or
# @foo:# bar # baz # indentedand they'll come out to the same thing (the
parser.pycode sends the same doc strings to the rST visitor).
If we enforce the second format in the QAPI schema parser, we save ourselves the trouble of normalizing the first format to the second one. We also promote more uniform style.
Re: [PATCH 08/29] qapi: Use ':' after @argument in doc comments
Quoted 15 lines · Markus Armbruster
Quoted 13 lines · Peter Maydell
Conveniently this patchset already supports this format :-) You can write either
# @foo: bar
# baz
# indentedor
# @foo:# bar # baz # indented
Quoted 6 lines
Quoted 2 lines
and they'll come out to the same thing (the
parser.pycode sends the same doc strings to the rST visitor).If we enforce the second format in the QAPI schema parser, we save ourselves the trouble of normalizing the first format to the second one. We also promote more uniform style.
You also end up requiring
# @foo:
# A short one-line description.
because it's the first style that makes this valid syntax:
# @foo: A short one-line description
And you're suggesting a big upheaval in doc comment style, because lots of the existing doc comment syntax uses the first version. I would really strongly prefer to not have "convert to supporting rST" also mean "and we have to touch every single JSON doc comment to convert away from a commonly used style that nobody has complained about in the past, which doesn't compromise the ability to include rST markup in the doc comment, and which was easy to support in the doc generator". This patchset is already quite large and has a lot of updates to QAPI doc comments. The one that makes the widest set of changes (patch 9/29) is bigger than I'd like and I think an important thing that makes it viable is that you can check with git show that it really is just changing whitespace, not even line breaks. Some of the style changes you're proposing would be much harder to verify as safe and touch much more of the JSON. If you'd like to do those I have no objection, but I really really don't want to tangle that up with the already large amount of work involved in transitioning away from texi to rST.
thanks
-- PMM
PATCH 9/29 qapi: Fix indent level on doc comments in json files
In reply to Peter MaydellThe texinfo doc generation doesn't care much about indentation levels, but we would like to add a rST backend, and rST does care about indentation.
Make the doc comments more strongly consistent about indentation for multiline constructs like:
@arg: description line 1
description line 2
Returns: line one
line 2
so that there is always exactly one space after the colon, and subsequent lines align with the first.
This commit is a purely whitespace change, and it does not alter the generated .texi files (because the texi generation code strips away all the extra whitespace). This does mean that we end up with some over-length lines.
Note that when the documentation for an argument fits on a single line like this:
@arg: one line only
then stray extra spaces after the ':' don't affect the rST output, so I have not attempted to methodically fix them, though the preference is a single space here too.
--- qapi/block-core.json | 776 +++++++++++++++++++-------------------- qapi/block.json | 14 +- qapi/char.json | 8 +- qapi/dump.json | 4 +- qapi/introspect.json | 12 +- qapi/job.json | 32 +- qapi/machine-target.json | 18 +- qapi/machine.json | 12 +- qapi/migration.json | 198 +++++----- qapi/misc-target.json | 8 +- qapi/misc.json | 102 ++--- qapi/net.json | 20 +- qapi/qdev.json | 10 +- qapi/qom.json | 4 +- qapi/rocker.json | 12 +- qapi/run-state.json | 34 +- qapi/sockets.json | 8 +- qapi/trace.json | 14 +- qapi/transaction.json | 4 +- qapi/ui.json | 36 +- 20 files changed, 663 insertions(+), 663 deletions(-)
qapi/block-core.json +388 -388
@@ -162,7 +162,7 @@ # @backing-image: info of the backing image (since 1.6) # # @format-specific: structure supplying additional format-specific -# information (since 1.7) +# information (since 1.7) # # Since: 1.3 #
@@ -708,7 +708,7 @@ # Get a list of BlockInfo for all virtual block devices. # # Returns: a list of @BlockInfo describing each virtual block device. Filter -# nodes that were created implicitly are skipped over. +# nodes that were created implicitly are skipped over. # # Since: 0.14.0 #
@@ -1352,8 +1352,8 @@ # @existing: QEMU should look for an existing image file. # # @absolute-paths: QEMU should create a new image with absolute paths -# for the backing file. If there is no backing file available, the new -# image will not be backed either. +# for the backing file. If there is no backing file available, the new +# image will not be backed either. # # Since: 1.1 ##
@@ -1370,8 +1370,8 @@ # @node-name: graph node name to generate the snapshot from (Since 2.0) # # @snapshot-file: the target of the new overlay image. If the file -# exists, or if it is a device, the overlay will be created in the -# existing file/device. Otherwise, a new file will be created. +# exists, or if it is a device, the overlay will be created in the +# existing file/device. Otherwise, a new file will be created. # # @snapshot-node-name: the graph node name of the new image (Since 2.0) #
@@ -1456,8 +1456,8 @@ # a node name is autogenerated. (Since: 4.2) # # Note: @on-source-error and @on-target-error only affect background -# I/O. If an error occurs during a guest write request, the device's -# rerror/werror actions will be used. +# I/O. If an error occurs during a guest write request, the device's +# rerror/werror actions will be used. # # Since: 4.2 ##
@@ -1578,13 +1578,13 @@ # to verify "image-node-name" is in the chain # described by "device". # -# @device: The device name or node-name of the root node that owns -# image-node-name. +# @device: The device name or node-name of the root node that owns +# image-node-name. # -# @backing-file: The string to write as the backing file. This -# string is not validated, so care should be taken -# when specifying the string or the image chain may -# not be able to be reopened again. +# @backing-file: The string to write as the backing file. This +# string is not validated, so care should be taken +# when specifying the string or the image chain may +# not be able to be reopened again. # # Returns: Nothing on success #
@@ -1605,7 +1605,7 @@ # @job-id: identifier for the newly-created block job. If # omitted, the device name will be used. (Since 2.7) # -# @device: the device name or node-name of a root node +# @device: the device name or node-name of a root node # # @base-node: The node name of the backing image to write data into. # If not specified, this is the deepest backing image.
@@ -1625,36 +1625,36 @@ # node; other strings, even if addressing the same file, are not # accepted (deprecated, use @base-node instead) # -# @backing-file: The backing file string to write into the overlay -# image of 'top'. If 'top' is the active layer, -# specifying a backing file string is an error. This -# filename is not validated. +# @backing-file: The backing file string to write into the overlay +# image of 'top'. If 'top' is the active layer, +# specifying a backing file string is an error. This +# filename is not validated. # -# If a pathname string is such that it cannot be -# resolved by QEMU, that means that subsequent QMP or -# HMP commands must use node-names for the image in -# question, as filename lookup methods will fail. +# If a pathname string is such that it cannot be +# resolved by QEMU, that means that subsequent QMP or +# HMP commands must use node-names for the image in +# question, as filename lookup methods will fail. # -# If not specified, QEMU will automatically determine -# the backing file string to use, or error out if -# there is no obvious choice. Care should be taken -# when specifying the string, to specify a valid -# filename or protocol. -# (Since 2.1) +# If not specified, QEMU will automatically determine +# the backing file string to use, or error out if +# there is no obvious choice. Care should be taken +# when specifying the string, to specify a valid +# filename or protocol. +# (Since 2.1) # -# If top == base, that is an error. -# If top == active, the job will not be completed by itself, -# user needs to complete the job with the block-job-complete -# command after getting the ready event. (Since 2.0) +# If top == base, that is an error. +# If top == active, the job will not be completed by itself, +# user needs to complete the job with the block-job-complete +# command after getting the ready event. (Since 2.0) # -# If the base image is smaller than top, then the base image -# will be resized to be the same size as top. If top is -# smaller than the base image, the base will not be -# truncated. If you want the base image size to match the -# size of the smaller top, you can safely truncate it -# yourself once the commit operation successfully completes. +# If the base image is smaller than top, then the base image +# will be resized to be the same size as top. If top is +# smaller than the base image, the base will not be +# truncated. If you want the base image size to match the +# size of the smaller top, you can safely truncate it +# yourself once the commit operation successfully completes. # -# @speed: the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # # @filter-node-name: the node name that should be assigned to the # filter driver that the commit job inserts into the graph
@@ -2439,52 +2439,52 @@ # @iops_wr: write I/O operations per second # # @bps_max: total throughput limit during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @bps_rd_max: read throughput limit during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @bps_wr_max: write throughput limit during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @iops_max: total I/O operations per second during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @iops_rd_max: read I/O operations per second during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @iops_wr_max: write I/O operations per second during bursts, -# in bytes (Since 1.7) +# in bytes (Since 1.7) # # @bps_max_length: maximum length of the @bps_max burst -# period, in seconds. It must only -# be set if @bps_max is set as well. -# Defaults to 1. (Since 2.6) +# period, in seconds. It must only +# be set if @bps_max is set as well. +# Defaults to 1. (Since 2.6) # # @bps_rd_max_length: maximum length of the @bps_rd_max -# burst period, in seconds. It must only -# be set if @bps_rd_max is set as well. -# Defaults to 1. (Since 2.6) +# burst period, in seconds. It must only +# be set if @bps_rd_max is set as well. +# Defaults to 1. (Since 2.6) # # @bps_wr_max_length: maximum length of the @bps_wr_max -# burst period, in seconds. It must only -# be set if @bps_wr_max is set as well. -# Defaults to 1. (Since 2.6) +# burst period, in seconds. It must only +# be set if @bps_wr_max is set as well. +# Defaults to 1. (Since 2.6) # # @iops_max_length: maximum length of the @iops burst -# period, in seconds. It must only -# be set if @iops_max is set as well. -# Defaults to 1. (Since 2.6) +# period, in seconds. It must only +# be set if @iops_max is set as well. +# Defaults to 1. (Since 2.6) # # @iops_rd_max_length: maximum length of the @iops_rd_max -# burst period, in seconds. It must only -# be set if @iops_rd_max is set as well. -# Defaults to 1. (Since 2.6) +# burst period, in seconds. It must only +# be set if @iops_rd_max is set as well. +# Defaults to 1. (Since 2.6) # # @iops_wr_max_length: maximum length of the @iops_wr_max -# burst period, in seconds. It must only -# be set if @iops_wr_max is set as well. -# Defaults to 1. (Since 2.6) +# burst period, in seconds. It must only +# be set if @iops_wr_max is set as well. +# Defaults to 1. (Since 2.6) # # @iops_size: an I/O size in bytes (Since 1.7) #
@@ -2511,31 +2511,31 @@ # transaction. All fields are optional. When setting limits, if a field is # missing the current value is not changed. # -# @iops-total: limit total I/O operations per second -# @iops-total-max: I/O operations burst -# @iops-total-max-length: length of the iops-total-max burst period, in seconds -# It must only be set if @iops-total-max is set as well. -# @iops-read: limit read operations per second -# @iops-read-max: I/O operations read burst -# @iops-read-max-length: length of the iops-read-max burst period, in seconds -# It must only be set if @iops-read-max is set as well. -# @iops-write: limit write operations per second -# @iops-write-max: I/O operations write burst -# @iops-write-max-length: length of the iops-write-max burst period, in seconds -# It must only be set if @iops-write-max is set as well. -# @bps-total: limit total bytes per second -# @bps-total-max: total bytes burst -# @bps-total-max-length: length of the bps-total-max burst period, in seconds. -# It must only be set if @bps-total-max is set as well. -# @bps-read: limit read bytes per second -# @bps-read-max: total bytes read burst -# @bps-read-max-length: length of the bps-read-max burst period, in seconds -# It must only be set if @bps-read-max is set as well. -# @bps-write: limit write bytes per second -# @bps-write-max: total bytes write burst -# @bps-write-max-length: length of the bps-write-max burst period, in seconds -# It must only be set if @bps-write-max is set as well. -# @iops-size: when limiting by iops max size of an I/O in bytes +# @iops-total: limit total I/O operations per second +# @iops-total-max: I/O operations burst +# @iops-total-max-length: length of the iops-total-max burst period, in seconds +# It must only be set if @iops-total-max is set as well. +# @iops-read: limit read operations per second +# @iops-read-max: I/O operations read burst +# @iops-read-max-length: length of the iops-read-max burst period, in seconds +# It must only be set if @iops-read-max is set as well. +# @iops-write: limit write operations per second +# @iops-write-max: I/O operations write burst +# @iops-write-max-length: length of the iops-write-max burst period, in seconds +# It must only be set if @iops-write-max is set as well. +# @bps-total: limit total bytes per second +# @bps-total-max: total bytes burst +# @bps-total-max-length: length of the bps-total-max burst period, in seconds. +# It must only be set if @bps-total-max is set as well. +# @bps-read: limit read bytes per second +# @bps-read-max: total bytes read burst +# @bps-read-max-length: length of the bps-read-max burst period, in seconds +# It must only be set if @bps-read-max is set as well. +# @bps-write: limit write bytes per second +# @bps-write-max: total bytes write burst +# @bps-write-max-length: length of the bps-write-max burst period, in seconds +# It must only be set if @bps-write-max is set as well. +# @iops-size: when limiting by iops max size of an I/O in bytes # # Since: 2.11 ##
@@ -2582,28 +2582,28 @@ # # @device: the device or node name of the top image # -# @base: the common backing file name. -# It cannot be set if @base-node is also set. +# @base: the common backing file name. +# It cannot be set if @base-node is also set. # # @base-node: the node name of the backing file. -# It cannot be set if @base is also set. (Since 2.8) +# It cannot be set if @base is also set. (Since 2.8) # # @backing-file: The backing file string to write into the top -# image. This filename is not validated. +# image. This filename is not validated. # -# If a pathname string is such that it cannot be -# resolved by QEMU, that means that subsequent QMP or -# HMP commands must use node-names for the image in -# question, as filename lookup methods will fail. +# If a pathname string is such that it cannot be +# resolved by QEMU, that means that subsequent QMP or +# HMP commands must use node-names for the image in +# question, as filename lookup methods will fail. # -# If not specified, QEMU will automatically determine -# the backing file string to use, or error out if there -# is no obvious choice. Care should be taken when -# specifying the string, to specify a valid filename or -# protocol. -# (Since 2.1) +# If not specified, QEMU will automatically determine +# the backing file string to use, or error out if there +# is no obvious choice. Care should be taken when +# specifying the string, to specify a valid filename or +# protocol. +# (Since 2.1) # -# @speed: the maximum speed, in bytes per second +# @speed: the maximum speed, in bytes per second # # @on-error: the action to take on an error (default report). # 'stop' and 'enospc' can only be used if the block device
@@ -2653,8 +2653,8 @@ # the name of the parameter), but since QEMU 2.7 it can have # other values. # -# @speed: the maximum speed, in bytes per second, or 0 for unlimited. -# Defaults to 0. +# @speed: the maximum speed, in bytes per second, or 0 for unlimited. +# Defaults to 0. # # Returns: Nothing on success # If no background operation is active on this device, DeviceNotActive
@@ -2820,8 +2820,8 @@ # # Determines how to handle discard requests. # -# @ignore: Ignore the request -# @unmap: Forward as an unmap request +# @ignore: Ignore the request +# @unmap: Forward as an unmap request # # Since: 2.9 ##
@@ -2834,10 +2834,10 @@ # Describes the operation mode for the automatic conversion of plain # zero writes by the OS to driver specific optimized zero write commands. # -# @off: Disabled (default) -# @on: Enabled -# @unmap: Enabled and even try to unmap blocks if possible. This requires -# also that @BlockdevDiscardOptions is set to unmap for this device. +# @off: Disabled (default) +# @on: Enabled +# @unmap: Enabled and even try to unmap blocks if possible. This requires +# also that @BlockdevDiscardOptions is set to unmap for this device. # # Since: 2.1 ##
@@ -2849,9 +2849,9 @@ # # Selects the AIO backend to handle I/O requests # -# @threads: Use qemu's thread pool -# @native: Use native AIO backend (only Linux and Windows) -# @io_uring: Use linux io_uring (since 5.0) +# @threads: Use qemu's thread pool +# @native: Use native AIO backend (only Linux and Windows) +# @io_uring: Use linux io_uring (since 5.0) # # Since: 2.9 ##
@@ -2864,10 +2864,10 @@ # # Includes cache-related options for block devices # -# @direct: enables use of O_DIRECT (bypass the host page cache; -# default: false) -# @no-flush: ignore any flush requests for the device (default: -# false) +# @direct: enables use of O_DIRECT (bypass the host page cache; +# default: false) +# @no-flush: ignore any flush requests for the device (default: +# false) # # Since: 2.9 ##
@@ -2905,18 +2905,18 @@ # # Driver specific block device options for the file backend. # -# @filename: path to the image file -# @pr-manager: the id for the object that will handle persistent reservations -# for this device (default: none, forward the commands via SG_IO; -# since 2.11) -# @aio: AIO backend (default: threads) (since: 2.8) -# @locking: whether to enable file locking. If set to 'auto', only enable -# when Open File Descriptor (OFD) locking API is available -# (default: auto, since 2.10) -# @drop-cache: invalidate page cache during live migration. This prevents -# stale data on the migration destination with cache.direct=off. -# Currently only supported on Linux hosts. -# (default: on, since: 4.0) +# @filename: path to the image file +# @pr-manager: the id for the object that will handle persistent reservations +# for this device (default: none, forward the commands via SG_IO; +# since 2.11) +# @aio: AIO backend (default: threads) (since: 2.8) +# @locking: whether to enable file locking. If set to 'auto', only enable +# when Open File Descriptor (OFD) locking API is available +# (default: auto, since 2.10) +# @drop-cache: invalidate page cache during live migration. This prevents +# stale data on the migration destination with cache.direct=off. +# Currently only supported on Linux hosts. +# (default: on, since: 4.0) # @x-check-cache-dropped: whether to check that page cache was dropped on live # migration. May cause noticeable delays if the image # file is large, do not use in production.
@@ -2949,7 +2949,7 @@ # # Driver specific block device options for the null backend. # -# @size: size of the device in bytes. +# @size: size of the device in bytes. # @latency-ns: emulated latency (in nanoseconds) in processing # requests. Default to zero which completes requests immediately. # (Since 2.4)
@@ -2966,8 +2966,8 @@ # # Driver specific block device options for the NVMe backend. # -# @device: PCI controller address of the NVMe device in -# format hhhh:bb:ss.f (host:bus:slot.function) +# @device: PCI controller address of the NVMe device in +# format hhhh:bb:ss.f (host:bus:slot.function) # @namespace: namespace number of the device, starting from 1. # # Note that the PCI @device must have been unbound from any host
@@ -2983,15 +2983,15 @@ # # Driver specific block device options for the vvfat protocol. # -# @dir: directory to be exported as FAT image -# @fat-type: FAT type: 12, 16 or 32 -# @floppy: whether to export a floppy image (true) or -# partitioned hard disk (false; default) -# @label: set the volume label, limited to 11 bytes. FAT16 and -# FAT32 traditionally have some restrictions on labels, which are -# ignored by most operating systems. Defaults to "QEMU VVFAT". -# (since 2.4) -# @rw: whether to allow write operations (default: false) +# @dir: directory to be exported as FAT image +# @fat-type: FAT type: 12, 16 or 32 +# @floppy: whether to export a floppy image (true) or +# partitioned hard disk (false; default) +# @label: set the volume label, limited to 11 bytes. FAT16 and +# FAT32 traditionally have some restrictions on labels, which are +# ignored by most operating systems. Defaults to "QEMU VVFAT". +# (since 2.4) +# @rw: whether to allow write operations (default: false) # # Since: 2.9 ##
@@ -3005,7 +3005,7 @@ # Driver specific block device options for image format that have no option # besides their data source. # -# @file: reference to or definition of the data source block device +# @file: reference to or definition of the data source block device # # Since: 2.9 ##
@@ -3034,9 +3034,9 @@ # Driver specific block device options for image format that have no option # besides their data source and an optional backing file. # -# @backing: reference to or definition of the backing file block -# device, null disables the backing file entirely. -# Defaults to the backing file stored the image file. +# @backing: reference to or definition of the backing file block +# device, null disables the backing file entirely. +# Defaults to the backing file stored the image file. # # Since: 2.9 ##
@@ -3049,15 +3049,15 @@ # # General overlap check modes. # -# @none: Do not perform any checks +# @none: Do not perform any checks # -# @constant: Perform only checks which can be done in constant time and -# without reading anything from disk +# @constant: Perform only checks which can be done in constant time and +# without reading anything from disk # -# @cached: Perform only checks which can be done without reading anything -# from disk +# @cached: Perform only checks which can be done without reading anything +# from disk # -# @all: Perform all available overlap checks +# @all: Perform all available overlap checks # # Since: 2.9 ##
@@ -3096,10 +3096,10 @@ # Specifies which metadata structures should be guarded against unintended # overwriting. # -# @flags: set of flags for separate specification of each metadata structure -# type +# @flags: set of flags for separate specification of each metadata structure +# type # -# @mode: named mode which chooses a specific set of flags +# @mode: named mode which chooses a specific set of flags # # Since: 2.9 ##
@@ -3132,9 +3132,9 @@ # # Driver specific block device options for qcow. # -# @encrypt: Image decryption options. Mandatory for -# encrypted images, except when doing a metadata-only -# probe of the image. +# @encrypt: Image decryption options. Mandatory for +# encrypted images, except when doing a metadata-only +# probe of the image. # # Since: 2.10 ##
@@ -3169,51 +3169,51 @@ # # Driver specific block device options for qcow2. # -# @lazy-refcounts: whether to enable the lazy refcounts -# feature (default is taken from the image file) +# @lazy-refcounts: whether to enable the lazy refcounts +# feature (default is taken from the image file) # -# @pass-discard-request: whether discard requests to the qcow2 -# device should be forwarded to the data source +# @pass-discard-request: whether discard requests to the qcow2 +# device should be forwarded to the data source # # @pass-discard-snapshot: whether discard requests for the data source # should be issued when a snapshot operation (e.g. # deleting a snapshot) frees clusters in the qcow2 file # -# @pass-discard-other: whether discard requests for the data source -# should be issued on other occasions where a cluster -# gets freed +# @pass-discard-other: whether discard requests for the data source +# should be issued on other occasions where a cluster +# gets freed # -# @overlap-check: which overlap checks to perform for writes -# to the image, defaults to 'cached' (since 2.2) +# @overlap-check: which overlap checks to perform for writes +# to the image, defaults to 'cached' (since 2.2) # -# @cache-size: the maximum total size of the L2 table and -# refcount block caches in bytes (since 2.2) +# @cache-size: the maximum total size of the L2 table and +# refcount block caches in bytes (since 2.2) # -# @l2-cache-size: the maximum size of the L2 table cache in -# bytes (since 2.2) +# @l2-cache-size: the maximum size of the L2 table cache in +# bytes (since 2.2) # -# @l2-cache-entry-size: the size of each entry in the L2 cache in -# bytes. It must be a power of two between 512 -# and the cluster size. The default value is -# the cluster size (since 2.12) +# @l2-cache-entry-size: the size of each entry in the L2 cache in +# bytes. It must be a power of two between 512 +# and the cluster size. The default value is +# the cluster size (since 2.12) # -# @refcount-cache-size: the maximum size of the refcount block cache -# in bytes (since 2.2) +# @refcount-cache-size: the maximum size of the refcount block cache +# in bytes (since 2.2) # -# @cache-clean-interval: clean unused entries in the L2 and refcount -# caches. The interval is in seconds. The default value -# is 600 on supporting platforms, and 0 on other -# platforms. 0 disables this feature. (since 2.5) +# @cache-clean-interval: clean unused entries in the L2 and refcount +# caches. The interval is in seconds. The default value +# is 600 on supporting platforms, and 0 on other +# platforms. 0 disables this feature. (since 2.5) # -# @encrypt: Image decryption options. Mandatory for -# encrypted images, except when doing a metadata-only -# probe of the image. (since 2.10) +# @encrypt: Image decryption options. Mandatory for +# encrypted images, except when doing a metadata-only +# probe of the image. (since 2.10) # -# @data-file: reference to or definition of the external data file. -# This may only be specified for images that require an -# external data file. If it is not specified for such -# an image, the data file name is loaded from the image -# file. (since 4.0) +# @data-file: reference to or definition of the external data file. +# This may only be specified for images that require an +# external data file. If it is not specified for such +# an image, the data file name is loaded from the image +# file. (since 4.0) # # Since: 2.9 ##
@@ -3304,8 +3304,8 @@ # # Trigger events supported by blkdebug. # -# @l1_shrink_write_table: write zeros to the l1 table to shrink image. -# (since 2.11) +# @l1_shrink_write_table: write zeros to the l1 table to shrink image. +# (since 2.11) # # @l1_shrink_free_l2_clusters: discard the l2 tables. (since 2.11) #
@@ -3363,25 +3363,25 @@ # # Describes a single error injection for blkdebug. # -# @event: trigger event +# @event: trigger event # -# @state: the state identifier blkdebug needs to be in to -# actually trigger the event; defaults to "any" +# @state: the state identifier blkdebug needs to be in to +# actually trigger the event; defaults to "any" # -# @iotype: the type of I/O operations on which this error should -# be injected; defaults to "all read, write, -# write-zeroes, discard, and flush operations" -# (since: 4.1) +# @iotype: the type of I/O operations on which this error should +# be injected; defaults to "all read, write, +# write-zeroes, discard, and flush operations" +# (since: 4.1) # -# @errno: error identifier (errno) to be returned; defaults to -# EIO +# @errno: error identifier (errno) to be returned; defaults to +# EIO # -# @sector: specifies the sector index which has to be affected -# in order to actually trigger the event; defaults to "any -# sector" +# @sector: specifies the sector index which has to be affected +# in order to actually trigger the event; defaults to "any +# sector" # -# @once: disables further events after this one has been -# triggered; defaults to false +# @once: disables further events after this one has been +# triggered; defaults to false # # @immediately: fail immediately; defaults to false #
@@ -3401,13 +3401,13 @@ # # Describes a single state-change event for blkdebug. # -# @event: trigger event +# @event: trigger event # -# @state: the current state identifier blkdebug needs to be in; -# defaults to "any" +# @state: the current state identifier blkdebug needs to be in; +# defaults to "any" # -# @new_state: the state identifier blkdebug is supposed to assume if -# this event is triggered +# @new_state: the state identifier blkdebug is supposed to assume if +# this event is triggered # # Since: 2.9 ##
@@ -3421,41 +3421,41 @@ # # Driver specific block device options for blkdebug. # -# @image: underlying raw block device (or image file) +# @image: underlying raw block device (or image file) # -# @config: filename of the configuration file +# @config: filename of the configuration file # -# @align: required alignment for requests in bytes, must be -# positive power of 2, or 0 for default +# @align: required alignment for requests in bytes, must be +# positive power of 2, or 0 for default # -# @max-transfer: maximum size for I/O transfers in bytes, must be -# positive multiple of @align and of the underlying -# file's request alignment (but need not be a power of -# 2), or 0 for default (since 2.10) +# @max-transfer: maximum size for I/O transfers in bytes, must be +# positive multiple of @align and of the underlying +# file's request alignment (but need not be a power of +# 2), or 0 for default (since 2.10) # -# @opt-write-zero: preferred alignment for write zero requests in bytes, -# must be positive multiple of @align and of the -# underlying file's request alignment (but need not be a -# power of 2), or 0 for default (since 2.10) +# @opt-write-zero: preferred alignment for write zero requests in bytes, +# must be positive multiple of @align and of the +# underlying file's request alignment (but need not be a +# power of 2), or 0 for default (since 2.10) # -# @max-write-zero: maximum size for write zero requests in bytes, must be -# positive multiple of @align, of @opt-write-zero, and of -# the underlying file's request alignment (but need not -# be a power of 2), or 0 for default (since 2.10) +# @max-write-zero: maximum size for write zero requests in bytes, must be +# positive multiple of @align, of @opt-write-zero, and of +# the underlying file's request alignment (but need not +# be a power of 2), or 0 for default (since 2.10) # -# @opt-discard: preferred alignment for discard requests in bytes, must -# be positive multiple of @align and of the underlying -# file's request alignment (but need not be a power of -# 2), or 0 for default (since 2.10) +# @opt-discard: preferred alignment for discard requests in bytes, must +# be positive multiple of @align and of the underlying +# file's request alignment (but need not be a power of +# 2), or 0 for default (since 2.10) # -# @max-discard: maximum size for discard requests in bytes, must be -# positive multiple of @align, of @opt-discard, and of -# the underlying file's request alignment (but need not -# be a power of 2), or 0 for default (since 2.10) +# @max-discard: maximum size for discard requests in bytes, must be +# positive multiple of @align, of @opt-discard, and of +# the underlying file's request alignment (but need not +# be a power of 2), or 0 for default (since 2.10) # -# @inject-error: array of error injection descriptions +# @inject-error: array of error injection descriptions # -# @set-state: array of state-change descriptions +# @set-state: array of state-change descriptions # # @take-child-perms: Permissions to take on @image in addition to what # is necessary anyway (which depends on how the
@@ -3485,14 +3485,14 @@ # # Driver specific block device options for blklogwrites. # -# @file: block device +# @file: block device # -# @log: block device used to log writes to @file +# @log: block device used to log writes to @file # # @log-sector-size: sector size used in logging writes to @file, determines # granularity of offsets and sizes of writes (default: 512) # -# @log-append: append to an existing log (default: false) +# @log-append: append to an existing log (default: false) # # @log-super-update-interval: interval of write requests after which the log # super block is updated to disk (default: 4096)
@@ -3511,9 +3511,9 @@ # # Driver specific block device options for blkverify. # -# @test: block device to be tested +# @test: block device to be tested # -# @raw: raw image used for verification +# @raw: raw image used for verification # # Since: 2.9 ##
@@ -3526,7 +3526,7 @@ # # Driver specific block device options for blkreplay. # -# @image: disk image which should be controlled with blkreplay +# @image: disk image which should be controlled with blkreplay # # Since: 4.2 ##
@@ -3551,10 +3551,10 @@ # # Driver specific block device options for Quorum # -# @blkverify: true if the driver must print content mismatch +# @blkverify: true if the driver must print content mismatch # set to false by default # -# @children: the children block devices to use +# @children: the children block devices to use # # @vote-threshold: the vote limit under which a read will fail #
@@ -3578,16 +3578,16 @@ # # Driver specific block device options for Gluster # -# @volume: name of gluster volume where VM image resides +# @volume: name of gluster volume where VM image resides # -# @path: absolute path to image file in gluster volume +# @path: absolute path to image file in gluster volume # -# @server: gluster servers description +# @server: gluster servers description # -# @debug: libgfapi log level (default '4' which is Error) -# (Since 2.8) +# @debug: libgfapi log level (default '4' which is Error) +# (Since 2.8) # -# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8) +# @logfile: libgfapi log file (default /dev/stderr) (Since 2.8) # # Since: 2.9 ##
@@ -3622,30 +3622,30 @@ ## # @BlockdevOptionsIscsi: # -# @transport: The iscsi transport type +# @transport: The iscsi transport type # -# @portal: The address of the iscsi portal +# @portal: The address of the iscsi portal # -# @target: The target iqn name +# @target: The target iqn name # -# @lun: LUN to connect to. Defaults to 0. +# @lun: LUN to connect to. Defaults to 0. # -# @user: User name to log in with. If omitted, no CHAP -# authentication is performed. +# @user: User name to log in with. If omitted, no CHAP +# authentication is performed. # # @password-secret: The ID of a QCryptoSecret object providing # the password for the login. This option is required if # @user is specified. # -# @initiator-name: The iqn name we want to identify to the target -# as. If this option is not specified, an initiator name is -# generated automatically. +# @initiator-name: The iqn name we want to identify to the target +# as. If this option is not specified, an initiator name is +# generated automatically. # -# @header-digest: The desired header digest. Defaults to -# none-crc32c. +# @header-digest: The desired header digest. Defaults to +# none-crc32c. # -# @timeout: Timeout in seconds after which a request will -# timeout. 0 means no timeout and is the default. +# @timeout: Timeout in seconds after which a request will +# timeout. 0 means no timeout and is the default. # # Driver specific block device options for iscsi #
@@ -3674,29 +3674,29 @@ ## # @BlockdevOptionsRbd: # -# @pool: Ceph pool name. +# @pool: Ceph pool name. # -# @image: Image name in the Ceph pool. +# @image: Image name in the Ceph pool. # -# @conf: path to Ceph configuration file. Values -# in the configuration file will be overridden by -# options specified via QAPI. +# @conf: path to Ceph configuration file. Values +# in the configuration file will be overridden by +# options specified via QAPI. # -# @snapshot: Ceph snapshot name. +# @snapshot: Ceph snapshot name. # -# @user: Ceph id name. +# @user: Ceph id name. # # @auth-client-required: Acceptable authentication modes. -# This maps to Ceph configuration option -# "auth_client_required". (Since 3.0) +# This maps to Ceph configuration option +# "auth_client_required". (Since 3.0) # -# @key-secret: ID of a QCryptoSecret object providing a key -# for cephx authentication. -# This maps to Ceph configuration option -# "key". (Since 3.0) +# @key-secret: ID of a QCryptoSecret object providing a key +# for cephx authentication. +# This maps to Ceph configuration option +# "key". (Since 3.0) # -# @server: Monitor host address and port. This maps -# to the "mon_host" Ceph option. +# @server: Monitor host address and port. This maps +# to the "mon_host" Ceph option. # # Since: 2.9 ##
@@ -3715,10 +3715,10 @@ # # Driver specific block device options for sheepdog # -# @vdi: Virtual disk image name -# @server: The Sheepdog server to connect to -# @snap-id: Snapshot ID -# @tag: Snapshot tag name +# @vdi: Virtual disk image name +# @server: The Sheepdog server to connect to +# @snap-id: Snapshot ID +# @tag: Snapshot tag name # # Only one of @snap-id and @tag may be present. #
@@ -3768,7 +3768,7 @@ # # An enumeration of NFS transport types # -# @inet: TCP transport +# @inet: TCP transport # # Since: 2.9 ##
@@ -3780,9 +3780,9 @@ # # Captures the address of the socket # -# @type: transport type used for NFS (only TCP supported) +# @type: transport type used for NFS (only TCP supported) # -# @host: host address for NFS server +# @host: host address for NFS server # # Since: 2.9 ##
@@ -3795,29 +3795,29 @@ # # Driver specific block device option for NFS # -# @server: host address +# @server: host address # -# @path: path of the image on the host +# @path: path of the image on the host # -# @user: UID value to use when talking to the -# server (defaults to 65534 on Windows and getuid() -# on unix) +# @user: UID value to use when talking to the +# server (defaults to 65534 on Windows and getuid() +# on unix) # -# @group: GID value to use when talking to the -# server (defaults to 65534 on Windows and getgid() -# in unix) +# @group: GID value to use when talking to the +# server (defaults to 65534 on Windows and getgid() +# in unix) # -# @tcp-syn-count: number of SYNs during the session -# establishment (defaults to libnfs default) +# @tcp-syn-count: number of SYNs during the session +# establishment (defaults to libnfs default) # -# @readahead-size: set the readahead size in bytes (defaults -# to libnfs default) +# @readahead-size: set the readahead size in bytes (defaults +# to libnfs default) # -# @page-cache-size: set the pagecache size in bytes (defaults -# to libnfs default) +# @page-cache-size: set the pagecache size in bytes (defaults +# to libnfs default) # -# @debug: set the NFS debug level (max 2) (defaults -# to libnfs default) +# @debug: set the NFS debug level (max 2) (defaults +# to libnfs default) # # Since: 2.9 ##
@@ -3837,22 +3837,22 @@ # Driver specific block device options shared by all protocols supported by the # curl backend. # -# @url: URL of the image file +# @url: URL of the image file # -# @readahead: Size of the read-ahead cache; must be a multiple of -# 512 (defaults to 256 kB) +# @readahead: Size of the read-ahead cache; must be a multiple of +# 512 (defaults to 256 kB) # -# @timeout: Timeout for connections, in seconds (defaults to 5) +# @timeout: Timeout for connections, in seconds (defaults to 5) # -# @username: Username for authentication (defaults to none) +# @username: Username for authentication (defaults to none) # -# @password-secret: ID of a QCryptoSecret object providing a password -# for authentication (defaults to no password) +# @password-secret: ID of a QCryptoSecret object providing a password +# for authentication (defaults to no password) # -# @proxy-username: Username for proxy authentication (defaults to none) +# @proxy-username: Username for proxy authentication (defaults to none) # -# @proxy-password-secret: ID of a QCryptoSecret object providing a password -# for proxy authentication (defaults to no password) +# @proxy-password-secret: ID of a QCryptoSecret object providing a password +# for proxy authentication (defaults to no password) # # Since: 2.9 ##
@@ -3871,9 +3871,9 @@ # Driver specific block device options for HTTP connections over the curl # backend. URLs must start with "http://". # -# @cookie: List of cookies to set; format is -# "name1=content1; name2=content2;" as explained by -# CURLOPT_COOKIE(3). Defaults to no cookies. +# @cookie: List of cookies to set; format is +# "name1=content1; name2=content2;" as explained by +# CURLOPT_COOKIE(3). Defaults to no cookies. # # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a # secure way. See @cookie for the format. (since 2.10)
@@ -3891,12 +3891,12 @@ # Driver specific block device options for HTTPS connections over the curl # backend. URLs must start with "https://". # -# @cookie: List of cookies to set; format is -# "name1=content1; name2=content2;" as explained by -# CURLOPT_COOKIE(3). Defaults to no cookies. +# @cookie: List of cookies to set; format is +# "name1=content1; name2=content2;" as explained by +# CURLOPT_COOKIE(3). Defaults to no cookies. # -# @sslverify: Whether to verify the SSL certificate's validity (defaults to -# true) +# @sslverify: Whether to verify the SSL certificate's validity (defaults to +# true) # # @cookie-secret: ID of a QCryptoSecret object providing the cookie data in a # secure way. See @cookie for the format. (since 2.10)
@@ -3927,8 +3927,8 @@ # Driver specific block device options for FTPS connections over the curl # backend. URLs must start with "ftps://". # -# @sslverify: Whether to verify the SSL certificate's validity (defaults to -# true) +# @sslverify: Whether to verify the SSL certificate's validity (defaults to +# true) # # Since: 2.9 ##
@@ -3941,11 +3941,11 @@ # # Driver specific block device options for NBD. # -# @server: NBD server address +# @server: NBD server address # -# @export: export name +# @export: export name # -# @tls-creds: TLS credentials ID +# @tls-creds: TLS credentials ID # # @x-dirty-bitmap: A "qemu:dirty-bitmap:NAME" string to query in place of # traditional "base:allocation" block status (see
@@ -3973,8 +3973,8 @@ # # Driver specific block device options for the raw driver. # -# @offset: position where the block device starts -# @size: the assumed size of the device +# @offset: position where the block device starts +# @size: the assumed size of the device # # Since: 2.9 ##
@@ -3987,9 +3987,9 @@ # # Driver specific block device options for VxHS # -# @vdisk-id: UUID of VxHS volume -# @server: vxhs server IP, port -# @tls-creds: TLS credentials ID +# @vdisk-id: UUID of VxHS volume +# @server: vxhs server IP, port +# @tls-creds: TLS credentials ID # # Since: 2.10 ##
@@ -4003,9 +4003,9 @@ # # Driver specific block device options for the throttle driver # -# @throttle-group: the name of the throttle-group object to use. It -# must already exist. -# @file: reference to or definition of the data source block device +# @throttle-group: the name of the throttle-group object to use. It +# must already exist. +# @file: reference to or definition of the data source block device # Since: 2.11 ## { 'struct': 'BlockdevOptionsThrottle',
@@ -4018,19 +4018,19 @@ # Options for creating a block device. Many options are available for all # block devices, independent of the block driver: # -# @driver: block driver name -# @node-name: the node name of the new node (Since 2.0). -# This option is required on the top level of blockdev-add. -# Valid node names start with an alphabetic character and may -# contain only alphanumeric characters, '-', '.' and '_'. Their -# maximum length is 31 characters. -# @discard: discard-related options (default: ignore) -# @cache: cache-related options -# @read-only: whether the block device should be read-only (default: false). -# Note that some block drivers support only read-only access, -# either generally or in certain configurations. In this case, -# the default value does not work and the option must be -# specified explicitly. +# @driver: block driver name +# @node-name: the node name of the new node (Since 2.0). +# This option is required on the top level of blockdev-add. +# Valid node names start with an alphabetic character and may +# contain only alphanumeric characters, '-', '.' and '_'. Their +# maximum length is 31 characters. +# @discard: discard-related options (default: ignore) +# @cache: cache-related options +# @read-only: whether the block device should be read-only (default: false). +# Note that some block drivers support only read-only access, +# either generally or in certain configurations. In this case, +# the default value does not work and the option must be +# specified explicitly. # @auto-read-only: if true and @read-only is false, QEMU may automatically # decide not to open the image read-write as requested, but # fall back to read-only instead (and switch between the modes
@@ -4039,8 +4039,8 @@ # (default: false, since 3.1) # @detect-zeroes: detect and optimize zero writes (Since 2.1) # (default: off) -# @force-share: force share all permission on added nodes. -# Requires read-only=true. (Since 2.10) +# @force-share: force share all permission on added nodes. +# Requires read-only=true. (Since 2.10) # # Remaining options are determined by the block driver. #
@@ -4106,8 +4106,8 @@ # # Reference to a block device. # -# @definition: defines a new block device inline -# @reference: references the ID of an existing block device +# @definition: defines a new block device inline +# @reference: references the ID of an existing block device # # Since: 2.9 ##
@@ -4120,11 +4120,11 @@ # # Reference to a block device. # -# @definition: defines a new block device inline -# @reference: references the ID of an existing block device. -# An empty string means that no block device should -# be referenced. Deprecated; use null instead. -# @null: No block device should be referenced (since 2.10) +# @definition: defines a new block device inline +# @reference: references the ID of an existing block device. +# An empty string means that no block device should +# be referenced. Deprecated; use null instead. +# @null: No block device should be referenced (since 2.10) # # Since: 2.9 ##
@@ -4765,12 +4765,12 @@ # # @device: Block device name (deprecated, use @id instead) # -# @id: The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # -# @force: if false (the default), an eject request will be sent to -# the guest if it has locked the tray (and the tray will not be opened -# immediately); if true, the tray will be opened regardless of whether -# it is locked +# @force: if false (the default), an eject request will be sent to +# the guest if it has locked the tray (and the tray will not be opened +# immediately); if true, the tray will be opened regardless of whether +# it is locked # # Since: 2.5 #
@@ -4803,9 +4803,9 @@ # # If the tray was already closed before, this will be a no-op. # -# @device: Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # # Since: 2.5 #
@@ -4837,7 +4837,7 @@ # # If the tray is open and there is no medium inserted, this will be a no-op. # -# @id: The name or QOM path of the guest device +# @id: The name or QOM path of the guest device # # Since: 2.12 #
@@ -4877,7 +4877,7 @@ # device's tray must currently be open (unless there is no attached guest # device) and there must be no medium inserted already. # -# @id: The name or QOM path of the guest device +# @id: The name or QOM path of the guest device # # @node-name: name of a node in the block driver state graph #
@@ -4911,11 +4911,11 @@ # Specifies the new read-only mode of a block device subject to the # @blockdev-change-medium command. # -# @retain: Retains the current read-only mode +# @retain: Retains the current read-only mode # -# @read-only: Makes the device read-only +# @read-only: Makes the device read-only # -# @read-write: Makes the device writable +# @read-write: Makes the device writable # # Since: 2.3 #
@@ -4932,18 +4932,18 @@ # combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium # and blockdev-close-tray). # -# @device: Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: The name or QOM path of the guest device -# (since: 2.8) +# @id: The name or QOM path of the guest device +# (since: 2.8) # -# @filename: filename of the new image to be loaded +# @filename: filename of the new image to be loaded # -# @format: format to open the new image with (defaults to -# the probed format) +# @format: format to open the new image with (defaults to +# the probed format) # -# @read-only-mode: change the read-only mode of the device; defaults -# to 'retain' +# @read-only-mode: change the read-only mode of the device; defaults +# to 'retain' # # Since: 2.5 #
@@ -5028,8 +5028,8 @@ # the access size # # @fatal: if set, the image is marked corrupt and therefore unusable after this -# event and must be repaired (Since 2.2; before, every -# BLOCK_IMAGE_CORRUPTED event was fatal) +# event and must be repaired (Since 2.2; before, every +# BLOCK_IMAGE_CORRUPTED event was fatal) # # Note: If action is "stop", a STOP event will eventually follow the # BLOCK_IO_ERROR event.
@@ -5077,10 +5077,10 @@ # # @reason: human readable string describing the error cause. # (This field is a debugging aid for humans, it should not -# be parsed by applications) (since: 2.2) +# be parsed by applications) (since: 2.2) # # Note: If action is "stop", a STOP event will eventually follow the -# BLOCK_IO_ERROR event +# BLOCK_IO_ERROR event # # Since: 0.13.0 #
@@ -5222,7 +5222,7 @@ # @speed: rate limit, bytes per second # # Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR -# event +# event # # Since: 1.3 #
@@ -5356,15 +5356,15 @@ # @node: the name of the node that will be added. # # Note: this command is experimental, and its API is not stable. It -# does not support all kinds of operations, all kinds of children, nor -# all block drivers. +# does not support all kinds of operations, all kinds of children, nor +# all block drivers. # -# FIXME Removing children from a quorum node means introducing gaps in the -# child indices. This cannot be represented in the 'children' list of -# BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename(). +# FIXME Removing children from a quorum node means introducing gaps in the +# child indices. This cannot be represented in the 'children' list of +# BlockdevOptionsQuorum, as returned by .bdrv_refresh_filename(). # -# Warning: The data in a new quorum child MUST be consistent with that of -# the rest of the array. +# Warning: The data in a new quorum child MUST be consistent with that of +# the rest of the array. # # Since: 2.7 #
@@ -5411,7 +5411,7 @@ # is already attached # # Note: this command is experimental and intended for test cases that need -# control over IOThreads only. +# control over IOThreads only. # # Since: 2.12 #
qapi/block.json +7 -7
@@ -190,12 +190,12 @@ # # Ejects a device from a removable drive. # -# @device: Block device name (deprecated, use @id instead) +# @device: Block device name (deprecated, use @id instead) # -# @id: The name or QOM path of the guest device (since: 2.8) +# @id: The name or QOM path of the guest device (since: 2.8) # -# @force: If true, eject regardless of whether the drive is locked. -# If not specified, the default value is false. +# @force: If true, eject regardless of whether the drive is locked. +# If not specified, the default value is false. # # Returns: Nothing on success #
@@ -251,7 +251,7 @@ # export name. (Since 2.12) # # @writable: Whether clients should be able to write to the device via the -# NBD connection (default false). +# NBD connection (default false). # @bitmap: Also export the dirty bitmap reachable from @device, so the # NBD client can use NBD_OPT_SET_META_CONTEXT with
@@ -278,10 +278,10 @@ # Potential additional modes to be added in the future: # # hide: Just hide export from new clients, leave existing connections as is. -# Remove export after all clients are disconnected. +# Remove export after all clients are disconnected. # # soft: Hide export from new clients, answer with ESHUTDOWN for all further -# requests from existing clients. +# requests from existing clients. # # Since: 2.12 ##
qapi/char.json +4 -4
@@ -262,11 +262,11 @@ # @tn3270: enable tn3270 protocol on server # sockets (default: false) (Since: 2.10) # @websocket: enable websocket protocol on server -# sockets (default: false) (Since: 3.1) +# sockets (default: false) (Since: 3.1) # @reconnect: For a client socket, if a socket is disconnected, -# then attempt a reconnect after the given number of seconds. -# Setting this to zero disables this function. (default: 0) -# (Since: 2.2) +# then attempt a reconnect after the given number of seconds. +# Setting this to zero disables this function. (default: 0) +# (Since: 2.2) # # Since: 1.4 ##
qapi/dump.json +2 -2
@@ -38,8 +38,8 @@ # using gdb to process the core file. # # IMPORTANT: this option can make QEMU allocate several gigabytes -# of RAM. This can happen for a large guest, or a -# malicious guest pretending to be large. +# of RAM. This can happen for a large guest, or a +# malicious guest pretending to be large. # # Also, paging=true has the following limitations: #
qapi/introspect.json +6 -6
@@ -34,15 +34,15 @@ # alternate that includes the original type alongside something else. # # Returns: array of @SchemaInfo, where each element describes an -# entity in the ABI: command, event, type, ... +# entity in the ABI: command, event, type, ... # -# The order of the various SchemaInfo is unspecified; however, all -# names are guaranteed to be unique (no name will be duplicated with -# different meta-types). +# The order of the various SchemaInfo is unspecified; however, all +# names are guaranteed to be unique (no name will be duplicated with +# different meta-types). # # Note: the QAPI schema is also used to help define *internal* -# interfaces, by defining QAPI types. These are not part of the QMP -# wire ABI, and therefore not returned by this command. +# interfaces, by defining QAPI types. These are not part of the QMP +# wire ABI, and therefore not returned by this command. # # Since: 2.5 ##
qapi/job.json +16 -16
@@ -214,28 +214,28 @@ # # Information about a job. # -# @id: The job identifier +# @id: The job identifier # -# @type: The kind of job that is being performed +# @type: The kind of job that is being performed # -# @status: Current job state/status +# @status: Current job state/status # -# @current-progress: Progress made until now. The unit is arbitrary and the -# value can only meaningfully be used for the ratio of -# @current-progress to @total-progress. The value is -# monotonically increasing. +# @current-progress: Progress made until now. The unit is arbitrary and the +# value can only meaningfully be used for the ratio of +# @current-progress to @total-progress. The value is +# monotonically increasing. # -# @total-progress: Estimated @current-progress value at the completion of -# the job. This value can arbitrarily change while the -# job is running, in both directions. +# @total-progress: Estimated @current-progress value at the completion of +# the job. This value can arbitrarily change while the +# job is running, in both directions. # -# @error: If this field is present, the job failed; if it is -# still missing in the CONCLUDED state, this indicates -# successful completion. +# @error: If this field is present, the job failed; if it is +# still missing in the CONCLUDED state, this indicates +# successful completion. # -# The value is a human-readable error message to describe -# the reason for the job failure. It should not be parsed -# by applications. +# The value is a human-readable error message to describe +# the reason for the job failure. It should not be parsed +# by applications. # # Since: 3.0 ##
qapi/machine-target.json +9 -9
@@ -40,13 +40,13 @@ # model details. # # Note: When a non-migration-safe CPU model is expanded in static mode, some -# features enabled by the CPU model may be omitted, because they can't be -# implemented by a static CPU model definition (e.g. cache info passthrough and -# PMU passthrough in x86). If you need an accurate representation of the -# features enabled by a non-migration-safe CPU model, use @full. If you need a -# static representation that will keep ABI compatibility even when changing QEMU -# version or machine-type, use @static (but keep in mind that some features may -# be omitted). +# features enabled by the CPU model may be omitted, because they can't be +# implemented by a static CPU model definition (e.g. cache info passthrough and +# PMU passthrough in x86). If you need an accurate representation of the +# features enabled by a non-migration-safe CPU model, use @full. If you need a +# static representation that will keep ABI compatibility even when changing QEMU +# version or machine-type, use @static (but keep in mind that some features may +# be omitted). # # Since: 2.8.0 ##
@@ -148,7 +148,7 @@ # with wrong types. # # Note: this command isn't specific to s390x, but is only implemented -# on this architecture currently. +# on this architecture currently. # # Since: 2.8.0 ##
@@ -191,7 +191,7 @@ # with wrong types. # # Note: this command isn't specific to s390x, but is only implemented -# on this architecture currently. +# on this architecture currently. # # Since: 2.8.0 ##
qapi/machine.json +6 -6
@@ -680,7 +680,7 @@ # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec. # # @none: None (no memory side cache in this proximity domain, -# or cache write policy unknown) +# or cache write policy unknown) # # @write-back: Write Back (WB) #
@@ -706,7 +706,7 @@ # @level: the cache level described in this structure. # # @associativity: the cache associativity, -# none/direct-mapped/complex(complex cache indexing). +# none/direct-mapped/complex(complex cache indexing). # # @policy: the write policy, none/write-back/write-through. #
@@ -823,10 +823,10 @@ # @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to # # Note: currently there are 5 properties that could be present -# but management should be prepared to pass through other -# properties with device_add command to allow for future -# interface extension. This also requires the filed names to be kept in -# sync with the properties passed to -device/device_add. +# but management should be prepared to pass through other +# properties with device_add command to allow for future +# interface extension. This also requires the filed names to be kept in +# sync with the properties passed to -device/device_add. # # Since: 2.7 ##
qapi/migration.json +99 -99
383 lines not on this page · raw message
qapi/misc-target.json +4 -4
@@ -230,14 +230,14 @@ # QEMU/KVM software version, but also decided by the hardware that # the program is running upon. # -# @version: version of GIC to be described. Currently, only 2 and 3 -# are supported. +# @version: version of GIC to be described. Currently, only 2 and 3 +# are supported. # # @emulated: whether current QEMU/hardware supports emulated GIC # device in user space. # -# @kernel: whether current QEMU/hardware supports hardware -# accelerated GIC device in kernel. +# @kernel: whether current QEMU/hardware supports hardware +# accelerated GIC device in kernel. # # Since: 2.6 ##
qapi/misc.json +51 -51
200 lines not on this page · raw message
qapi/net.json +10 -10
@@ -47,9 +47,9 @@ # Additional arguments depend on the type. # # TODO: This command effectively bypasses QAPI completely due to its -# "additional arguments" business. It shouldn't have been added to -# the schema in this form. It should be qapified properly, or -# replaced by a properly qapified command. +# "additional arguments" business. It shouldn't have been added to +# the schema in this form. It should be qapified properly, or +# replaced by a properly qapified command. # # Since: 0.14.0 #
@@ -213,7 +213,7 @@ # @fd: file descriptor of an already opened tap # # @fds: multiple file descriptors of already opened multiqueue capable -# tap +# tap # # @script: script to initialize the interface #
@@ -232,14 +232,14 @@ # @vhostfd: file descriptor of an already opened vhost net device # # @vhostfds: file descriptors of multiple already opened vhost net -# devices +# devices # # @vhostforce: vhost on for non-MSIX virtio guests # # @queues: number of queues to be created for multiqueue capable tap # # @poll-us: maximum number of microseconds that could -# be spent on busy polling for tap (since 2.7) +# be spent on busy polling for tap (since 2.7) # # Since: 1.2 ##
@@ -691,7 +691,7 @@ # Parameters for self-announce timers # # @initial: Initial delay (in ms) before sending the first GARP/RARP -# announcement +# announcement # # @max: Maximum delay (in ms) between GARP/RARP announcement packets #
@@ -700,11 +700,11 @@ # @step: Delay increase (in ms) after each self-announcement attempt # # @interfaces: An optional list of interface names, which restricts the -# announcement to the listed interfaces. (Since 4.1) +# announcement to the listed interfaces. (Since 4.1) # # @id: A name to be used to identify an instance of announce-timers -# and to allow it to modified later. Not for use as -# part of the migration parameters. (Since 4.1) +# and to allow it to modified later. Not for use as +# part of the migration parameters. (Since 4.1) # # Since: 4.0 ##
qapi/qdev.json +5 -5
@@ -19,8 +19,8 @@ # Returns: a list of ObjectPropertyInfo describing a devices properties # # Note: objects can create properties at runtime, for example to describe -# links between different devices and/or objects. These properties -# are not included in the output of this command. +# links between different devices and/or objects. These properties +# are not included in the output of this command. # # Since: 1.2 ##
@@ -58,9 +58,9 @@ # <- { "return": {} } # # TODO: This command effectively bypasses QAPI completely due to its -# "additional arguments" business. It shouldn't have been added to -# the schema in this form. It should be qapified properly, or -# replaced by a properly qapified command. +# "additional arguments" business. It shouldn't have been added to +# the schema in this form. It should be qapified properly, or +# replaced by a properly qapified command. # # Since: 0.13 ##
qapi/qom.json +2 -2
@@ -189,8 +189,8 @@ # @typename: the type name of an object # # Note: objects can create properties at runtime, for example to describe -# links between different devices and/or objects. These properties -# are not included in the output of this command. +# links between different devices and/or objects. These properties +# are not included in the output of this command. # # Returns: a list of ObjectPropertyInfo describing object properties #
qapi/rocker.json +6 -6
@@ -140,7 +140,7 @@ # @ip-dst: IP header destination address # # Note: optional members may or may not appear in the flow key -# depending if they're relevant to the flow key. +# depending if they're relevant to the flow key. # # Since: 2.4 ##
@@ -170,7 +170,7 @@ # @ip-tos: IP header TOS field # # Note: optional members may or may not appear in the flow mask -# depending if they're relevant to the flow mask. +# depending if they're relevant to the flow mask. # # Since: 2.4 ##
@@ -197,7 +197,7 @@ # @out-pport: physical output port # # Note: optional members may or may not appear in the flow action -# depending if they're relevant to the flow action. +# depending if they're relevant to the flow action. # # Since: 2.4 ##
@@ -235,7 +235,7 @@ # @name: switch name # # @tbl-id: 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 #
@@ -291,7 +291,7 @@ # @ttl-check: perform TTL check # # Note: optional members may or may not appear in the group depending -# if they're relevant to the group type. +# if they're relevant to the group type. # # Since: 2.4 ##
@@ -311,7 +311,7 @@ # @name: switch name # # @type: 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 #
qapi/run-state.json +17 -17
@@ -15,16 +15,16 @@ # @finish-migrate: guest is paused to finish the migration process # # @inmigrate: guest is paused waiting for an incoming migration. Note -# that this state does not tell whether the machine will start at the -# end of the migration. This depends on the command-line -S option and -# any invocation of 'stop' or 'cont' that has happened since QEMU was -# started. +# that this state does not tell whether the machine will start at the +# end of the migration. This depends on the command-line -S option and +# any invocation of 'stop' or 'cont' that has happened since QEMU was +# started. # # @internal-error: An internal error that prevents further guest execution -# has occurred +# has occurred # # @io-error: the last IOP has failed and the device is configured to pause -# on I/O errors +# on I/O errors # # @paused: guest has been paused via the 'stop' command #
@@ -85,8 +85,8 @@ # @guest-panic: Guest panicked, and command line turns that into a shutdown # # @subsystem-reset: Partial guest reset that does not trigger QMP events and -# ignores --no-reboot. This is useful for sanitizing -# hypercalls on s390 that are used during kexec/kdump/boot +# ignores --no-reboot. This is useful for sanitizing +# hypercalls on s390 that are used during kexec/kdump/boot # ## { 'enum': 'ShutdownCause',
@@ -140,13 +140,13 @@ # about to exit. # # @guest: If true, the shutdown was triggered by a guest request (such as -# a guest-initiated ACPI shutdown request or other hardware-specific action) -# rather than a host request (such as sending qemu a SIGINT). (since 2.10) +# a guest-initiated ACPI shutdown request or other hardware-specific action) +# rather than a host request (such as sending qemu a SIGINT). (since 2.10) # # @reason: The @ShutdownCause which resulted in the SHUTDOWN. (since 4.0) # # Note: If the command-line option "-no-shutdown" has been specified, qemu will -# not exit, and a STOP event will eventually follow the SHUTDOWN event +# not exit, and a STOP event will eventually follow the SHUTDOWN event # # Since: 0.12.0 #
@@ -180,9 +180,9 @@ # Emitted when the virtual machine is reset # # @guest: If true, the reset was triggered by a guest request (such as -# a guest-initiated ACPI reboot request or other hardware-specific action) -# rather than a host request (such as the QMP command system_reset). -# (since 2.10) +# a guest-initiated ACPI reboot request or other hardware-specific action) +# rather than a host request (such as the QMP command system_reset). +# (since 2.10) # # @reason: The @ShutdownCause of the RESET. (since 4.0) #
@@ -283,7 +283,7 @@ # @action: action that has been taken # # Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is -# followed respectively by the RESET, SHUTDOWN, or STOP events +# followed respectively by the RESET, SHUTDOWN, or STOP events # # Note: This event is rate-limited. #
@@ -441,12 +441,12 @@ # @disabled-wait: the CPU has entered a disabled wait state # # @extint-loop: clock comparator or cpu timer interrupt with new PSW enabled -# for external interrupts +# for external interrupts # # @pgmint-loop: program interrupt with BAD new PSW # # @opint-loop: operation exception interrupt with invalid code at the program -# interrupt new PSW +# interrupt new PSW # # Since: 2.12 ##
qapi/sockets.json +4 -4
@@ -89,7 +89,7 @@ # @port: port # # Note: string types are used to allow for possible future hostname or -# service resolution support. +# service resolution support. # # Since: 2.8 ##
@@ -104,9 +104,9 @@ # Captures the address of a socket, which could also be a named file descriptor # # Note: This type is deprecated in favor of SocketAddress. The -# difference between SocketAddressLegacy and SocketAddress is that the -# latter is a flat union rather than a simple union. Flat is nicer -# because it avoids nesting on the wire, i.e. that form has fewer {}. +# difference between SocketAddressLegacy and SocketAddress is that the +# latter is a flat union rather than a simple union. Flat is nicer +# because it avoids nesting on the wire, i.e. that form has fewer {}. # # Since: 1.3
qapi/trace.json +7 -7
@@ -52,14 +52,14 @@ # # Returns: a list of @TraceEventInfo for the matching events # -# An event is returned if: -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# An event is returned if: +# - its name matches the @name pattern, and +# - if @vcpu is given, the event has the "vcpu" property. # -# Therefore, if @vcpu is given, the operation will only match per-vCPU events, -# returning their state on the specified vCPU. Special case: if @name is an -# exact match, @vcpu is given and the event does not have the "vcpu" property, -# an error is returned. +# Therefore, if @vcpu is given, the operation will only match per-vCPU events, +# returning their state on the specified vCPU. Special case: if @name is an +# exact match, @vcpu is given and the event does not have the "vcpu" property, +# an error is returned. # # Since: 2.2 #
qapi/transaction.json +2 -2
@@ -132,8 +132,8 @@ # Errors depend on the operations of the transaction # # Note: The transaction aborts on the first failure. Therefore, there will be -# information on only one failed operation returned in an error condition, and -# subsequent actions will not have been attempted. +# information on only one failed operation returned in an error condition, and +# subsequent actions will not have been attempted. # # Since: 1.1 #
qapi/ui.json +18 -18
@@ -18,10 +18,10 @@ # @password: the new password # # @connected: how to handle existing clients when changing the -# password. If nothing is specified, defaults to `keep' -# `fail' to fail the command if clients are connected -# `disconnect' to disconnect existing clients -# `keep' to maintain existing clients +# password. If nothing is specified, defaults to `keep' +# `fail' to fail the command if clients are connected +# `disconnect' to disconnect existing clients +# `keep' to maintain existing clients # # Returns: Nothing on success # If Spice is not enabled, DeviceNotFound
@@ -591,12 +591,12 @@ # # Change the VNC server password. # -# @password: the new password to use with VNC authentication +# @password: the new password to use with VNC authentication # # Since: 1.1 # -# Notes: An empty password in this command will set the password to the empty -# string. Existing clients are unaffected by executing this command. +# Notes: An empty password in this command will set the password to the empty +# string. Existing clients are unaffected by executing this command. ## { 'command': 'change-vnc-password', 'data': { 'password': 'str' },
@@ -612,7 +612,7 @@ # @client: client information # # Note: This event is emitted before any authentication takes place, thus -# the authentication ID is not provided +# the authentication ID is not provided # # Since: 0.13.0 #
@@ -915,9 +915,9 @@ # # Pointer motion input event. # -# @axis: Which axis is referenced by @value. -# @value: Pointer position. For absolute coordinates the -# valid range is 0 -> 0x7ffff +# @axis: Which axis is referenced by @value. +# @value: Pointer position. For absolute coordinates the +# valid range is 0 -> 0x7ffff # # Since: 2.0 ##
@@ -931,10 +931,10 @@ # Input event union. # # @type: the input type, one of: -# - 'key': Input event of Keyboard -# - 'btn': Input event of pointer buttons -# - 'rel': Input event of relative pointer motion -# - 'abs': Input event of absolute pointer motion +# - 'key': Input event of Keyboard +# - 'btn': Input event of pointer buttons +# - 'rel': Input event of relative pointer motion +# - 'abs': Input event of absolute pointer motion # # Since: 2.0 ##
@@ -970,9 +970,9 @@ # Since: 2.6 # # Note: The consoles are visible in the qom tree, under -# /backend/console[$index]. They have a device link and head property, -# so it is possible to map which console belongs to which device and -# display. +# /backend/console[$index]. They have a device link and head property, +# so it is possible to map which console belongs to which device and +# display. # # Example: #
Signature · 1 line
2.20.1
Re: [PATCH 09/29] qapi: Fix indent level on doc comments in json files
Quoted 13 lines · Peter Maydell
The texinfo doc generation doesn't care much about indentation levels, but we would like to add a rST backend, and rST does care about indentation.
Make the doc comments more strongly consistent about indentation for multiline constructs like:
@arg: description line 1
description line 2Returns: line one
line 2
Quoted 7 lines
so that there is always exactly one space after the colon, and subsequent lines align with the first.
This commit is a purely whitespace change, and it does not alter the generated .texi files (because the texi generation code strips away all the extra whitespace). This does mean that we end up with some over-length lines.
Overlong lines need to be corrected. Not necessarily in this patch.
Quoted 10 lines
Note that when the documentation for an argument fits on a single line like this:
@arg: one line only
then stray extra spaces after the ':' don't affect the rST output, so I have not attempted to methodically fix them, though the preference is a single space here too.
Signed-off-by Peter Maydell <[email protected]>
Same commit message body as PATCH 05, except for the line wrapping. I like PATCH 05's better.
PATCH 10/29 qapi: Remove hardcoded tabs
In reply to Peter MaydellThere are some stray hardcoded tabs in some of our json files; remove them.
---
Most of the hardcoded tabs got removed in passing in fixing the indent in lines that they were in, but these are not part of doc comments.
--- qapi/block-core.json | 4 ++-- qapi/migration.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
qapi/block-core.json +2 -2
@@ -2938,8 +2938,8 @@ '*pr-manager': 'str', '*locking': 'OnOffAuto', '*aio': 'BlockdevAioOptions', - '*drop-cache': {'type': 'bool', - 'if': 'defined(CONFIG_LINUX)'}, + '*drop-cache': {'type': 'bool', + 'if': 'defined(CONFIG_LINUX)'}, '*x-check-cache-dropped': 'bool' }, 'features': [ { 'name': 'dynamic-auto-read-only', 'if': 'defined(CONFIG_POSIX)' } ] }
qapi/migration.json +3 -3
@@ -98,7 +98,7 @@ ## { 'struct': 'CompressionStats', 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number', - 'compressed-size': 'int', 'compression-rate': 'number' } } + 'compressed-size': 'int', 'compression-rate': 'number' } } ## # @MigrationStatus:
@@ -713,7 +713,7 @@ '*multifd-channels': 'int', '*xbzrle-cache-size': 'size', '*max-postcopy-bandwidth': 'size', - '*max-cpu-throttle': 'int' } } + '*max-cpu-throttle': 'int' } } ## # @migrate-set-parameters:
@@ -845,7 +845,7 @@ '*block-incremental': 'bool' , '*multifd-channels': 'uint8', '*xbzrle-cache-size': 'size', - '*max-postcopy-bandwidth': 'size', + '*max-postcopy-bandwidth': 'size', '*max-cpu-throttle':'uint8'} } ##
Signature · 1 line
2.20.1
Re: [PATCH 10/29] qapi: Remove hardcoded tabs
Quoted 8 lines · Peter Maydell
There are some stray hardcoded tabs in some of our json files; remove them.
Signed-off-by Peter Maydell <[email protected]>---
Most of the hardcoded tabs got removed in passing in fixing the indent in lines that they were in, but these are not part of doc comments.
PATCH 11/29 qapi/ui.json: Put input-send-event body text in the right place
In reply to Peter MaydellIn the doc comment for input-send-event, there is a multi-line chunk of text ("The @device...take precedence") which is intended to be the main body text describing the event. However it has been placed after the arguments and Returns: section, which means that the parser actually thinks that this text is part of the "Returns" section text.
Move the body text up to the top so that the parser correctly classifies it as body.
--- qapi/ui.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
qapi/ui.json +7 -7
@@ -949,13 +949,6 @@ # # Send input event(s) to guest. # -# @device: display device to send event(s) to. -# @head: head to send event(s) to, in case the -# display device supports multiple scanouts. -# @events: List of InputEvent union. -# -# Returns: Nothing on success. -# # The @device and @head parameters can be used to send the input event # to specific input devices in case (a) multiple input devices of the # same kind are added to the virtual machine and (b) you have
@@ -967,6 +960,13 @@ # are admissible, but devices with input routing config take # precedence. # +# @device: display device to send event(s) to. +# @head: head to send event(s) to, in case the +# display device supports multiple scanouts. +# @events: List of InputEvent union. +# +# Returns: Nothing on success. +# # Since: 2.6 # # Note: The consoles are visible in the qom tree, under
Signature · 1 line
2.20.1
Re: [PATCH 11/29] qapi/ui.json: Put input-send-event body text in the right place
Quoted 37 lines · Peter Maydell
In the doc comment for input-send-event, there is a multi-line chunk of text ("The @device...take precedence") which is intended to be the main body text describing the event. However it has been placed after the arguments and Returns: section, which means that the parser actually thinks that this text is part of the "Returns" section text.
Move the body text up to the top so that the parser correctly classifies it as body.
Signed-off-by Peter Maydell <[email protected]>--- qapi/ui.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)qapi/ui.json +0
-7@@ -949,13 +949,6 @@ # # Send input event(s) to guest. # -# @device: display device to send event(s) to. -# @head: head to send event(s) to, in case the -# display device supports multiple scanouts. -# @events: List of InputEvent union. -# -# Returns: Nothing on success. -# # The @device and @head parameters can be used to send the input event # to specific input devices in case (a) multiple input devices of the # same kind are added to the virtual machine and (b) you have@@ -967,6 +960,13 @@ # are admissible, but devices with input routing config take # precedence. #
qapi/ui.json line 972
Quoted 10 lines
qapi/ui.json +7
-0+# @device: display device to send event(s) to. +# @head: head to send event(s) to, in case the +# display device supports multiple scanouts. +# @events: List of InputEvent union. +# +# Returns: Nothing on success. +# # Since: 2.6 # # Note: The consoles are visible in the qom tree, under
PATCH 12/29 qapi: Explicitly put "foo: dropped in n.n" notes into Notes section
In reply to Peter MaydellA handful of QAPI doc comments include lines like "ppcemb: dropped in 3.1". The doc comment parser will just put these into whatever the preceding section was; sometimes that's "Notes", and sometimes it's some random other section, as with "NetClientDriver" where the "'dump': dropped in 2.12" line ends up in the "Since:" section.
Put all of these explicitly into Notes: sections (either preexisting or new), with the right indentation, and standardising on quoting of the symbol with ''.
In the case of QKeyCode, the generated docs were actively misformatted:
ac_bookmarks
since 2.10 altgr, altgr_r: dropped in 2.10
--- qapi/machine.json | 2 +- qapi/net.json | 6 +++--- qapi/ui.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-)
qapi/machine.json +1 -1
@@ -20,7 +20,7 @@ # prefix to produce the corresponding QEMU executable name. This # is true even for "qemu-system-x86_64". # -# ppcemb: dropped in 3.1 +# 'ppcemb': dropped in 3.1 # # Since: 3.0 ##
qapi/net.json +3 -3
@@ -447,7 +447,7 @@ # # Since: 2.7 # -# 'dump': dropped in 2.12 +# Notes: 'dump': dropped in 2.12 ## { 'enum': 'NetClientDriver', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',
@@ -464,7 +464,7 @@ # # Since: 1.2 # -# 'l2tpv3' - since 2.1 +# Notes: 'l2tpv3' - since 2.1 ## { 'union': 'Netdev', 'base': { 'id': 'str', 'type': 'NetClientDriver' },
@@ -494,7 +494,7 @@ # # Since: 1.2 # -# 'vlan': dropped in 3.0 +# Notes: 'vlan': dropped in 3.0 ## { 'struct': 'NetLegacy', 'data': {
qapi/ui.json +2 -1
@@ -776,7 +776,6 @@ # @ac_forward: since 2.10 # @ac_refresh: since 2.10 # @ac_bookmarks: since 2.10 -# altgr, altgr_r: dropped in 2.10 # # @muhenkan: since 2.12 # @katakanahiragana: since 2.12
@@ -790,6 +789,8 @@ # # Since: 1.3.0 # +# Notes: - 'altgr': dropped in 2.10 +# - 'altgr_r': dropped in 2.10 ## { 'enum': 'QKeyCode', 'data': [ 'unmapped',
Signature · 1 line
2.20.1
Re: [PATCH 12/29] qapi: Explicitly put "foo: dropped in n.n" notes into Notes section
Quoted 80 lines · Peter Maydell
A handful of QAPI doc comments include lines like "ppcemb: dropped in 3.1". The doc comment parser will just put these into whatever the preceding section was; sometimes that's "Notes", and sometimes it's some random other section, as with "NetClientDriver" where the "'dump': dropped in 2.12" line ends up in the "Since:" section.
Put all of these explicitly into Notes: sections (either preexisting or new), with the right indentation, and standardising on quoting of the symbol with ''.
In the case of QKeyCode, the generated docs were actively misformatted:
ac_bookmarks since 2.10 altgr, altgr_r: dropped in 2.10Signed-off-by Peter Maydell <[email protected]>--- qapi/machine.json | 2 +- qapi/net.json | 6 +++--- qapi/ui.json | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-)qapi/machine.json +1
-1@@ -20,7 +20,7 @@ # prefix to produce the corresponding QEMU executable name. This # is true even for "qemu-system-x86_64". # -# ppcemb: dropped in 3.1 +# 'ppcemb': dropped in 3.1 # # Since: 3.0 ##qapi/net.json +3
-3@@ -447,7 +447,7 @@ # # Since: 2.7 # -# 'dump': dropped in 2.12 +# Notes: 'dump': dropped in 2.12 ## { 'enum': 'NetClientDriver', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde',@@ -464,7 +464,7 @@ # # Since: 1.2 # -# 'l2tpv3' - since 2.1 +# Notes: 'l2tpv3' - since 2.1 ## { 'union': 'Netdev', 'base': { 'id': 'str', 'type': 'NetClientDriver' },@@ -494,7 +494,7 @@ # # Since: 1.2 # -# 'vlan': dropped in 3.0 +# Notes: 'vlan': dropped in 3.0 ## { 'struct': 'NetLegacy', 'data': {qapi/ui.json +0
-1@@ -776,7 +776,6 @@ # @ac_forward: since 2.10 # @ac_refresh: since 2.10 # @ac_bookmarks: since 2.10 -# altgr, altgr_r: dropped in 2.10 # # @muhenkan: since 2.12 # @katakanahiragana: since 2.12
qapi/ui.json line 796
Quoted 8 lines
qapi/ui.json +2
-0@@ -790,6 +789,8 @@ # # Since: 1.3.0 # +# Notes: - 'altgr': dropped in 2.10 +# - 'altgr_r': dropped in 2.10 ## { 'enum': 'QKeyCode', 'data': [ 'unmapped',
I'm not sure the "dropped in" notes are worth their keep. One, they are too incomplete to be of much use. Two, I think qemu-deprecated.texi is a better home for this kind of information. Easier to consume for the people who need to know. In particular, they can watch the sausage being made by getting themselves added to MAINTAINERS section "Incompatible changes".
If we decide we want to document "dropped in" in the schema, then we need to make an effort to reconstruct the missing ones. Also, members names should use @name markup, not 'name'.
Cc'ing people ratted out by git-log -S'dropped in'.
Re: [PATCH 12/29] qapi: Explicitly put "foo: dropped in n.n" notes into Notes section
Quoted 15 lines · Markus Armbruster
Quoted 11 lines · Peter Maydell
A handful of QAPI doc comments include lines like "ppcemb: dropped in 3.1". The doc comment parser will just put these into whatever the preceding section was; sometimes that's "Notes", and sometimes it's some random other section, as with "NetClientDriver" where the "'dump': dropped in 2.12" line ends up in the "Since:" section.
Put all of these explicitly into Notes: sections (either preexisting or new), with the right indentation, and standardising on quoting of the symbol with ''.
Quoted 6 lines
I'm not sure the "dropped in" notes are worth their keep. One, they are too incomplete to be of much use. Two, I think qemu-deprecated.texi is a better home for this kind of information. Easier to consume for the people who need to know. In particular, they can watch the sausage being made by getting themselves added to
MAINTAINERSsection "Incompatible changes".
We first started adding dropped-in notes at least as early as commit 912092b (part of v2.10.0), with the 'altgr'/'altgr_r' members of QKeyCode. We did not have qemu-deprecated.texi until commit 44c67847 (v3.0.0), so the markings originally made sense.
But now that we have a better place for someone to look up "why is my QAPI command not working? oh, qemu-deprecated documents that it was removed, AND tells me details such as why it was useless or what to use in its place", I don't see the need to burden QAPI docs with a mere "this old form with no further documentation used to exist, but you can't use it now, and furthermore this tidbit of information didn't teach you anything useful about what _does_ work with this command" line.
Quoted 6 lines
If we decide we want to document "dropped in" in the schema, then we need to make an effort to reconstruct the missing ones. Also, members names should use @name markup, not 'name'.
Cc'ing people ratted out by git-log -S'dropped in'.
I'm all in favor of stopping the use of 'dropped in' in QAPI source files, and sticking to qemu-deprecated.texi instead.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
PATCH 13/29 qapi/ui.json: Avoid `...' texinfo style quoting
In reply to Peter MaydellAvoid texinfo style quoting with `...', because rST treats it as a syntax error. Use '...' instead, as we do in other doc comments. This looks OK in texinfo, and rST formats it as paired-quotation-marks.
--- qapi/ui.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
qapi/ui.json +12 -12
@@ -12,16 +12,16 @@ # # Sets the password of a remote display session. # -# @protocol: `vnc' to modify the VNC server password -# `spice' to modify the Spice server password +# @protocol: 'vnc' to modify the VNC server password +# 'spice' to modify the Spice server password # # @password: the new password # # @connected: how to handle existing clients when changing the -# password. If nothing is specified, defaults to `keep' -# `fail' to fail the command if clients are connected -# `disconnect' to disconnect existing clients -# `keep' to maintain existing clients +# password. If nothing is specified, defaults to 'keep' +# 'fail' to fail the command if clients are connected +# 'disconnect' to disconnect existing clients +# 'keep' to maintain existing clients # # Returns: Nothing on success # If Spice is not enabled, DeviceNotFound
@@ -43,16 +43,16 @@ # # Expire the password of a remote display server. # -# @protocol: the name of the remote display protocol `vnc' or `spice' +# @protocol: the name of the remote display protocol 'vnc' or 'spice' # # @time: when to expire the password. -# `now' to expire the password immediately -# `never' to cancel password expiration -# `+INT' where INT is the number of seconds from now (integer) -# `INT' where INT is the absolute time in seconds +# 'now' to expire the password immediately +# 'never' to cancel password expiration +# '+INT' where INT is the number of seconds from now (integer) +# 'INT' where INT is the absolute time in seconds # # Returns: Nothing on success -# If @protocol is `spice' and Spice is not active, DeviceNotFound +# If @protocol is 'spice' and Spice is not active, DeviceNotFound # # Since: 0.14.0 #
Signature · 1 line
2.20.1
Re: [PATCH 13/29] qapi/ui.json: Avoid `...' texinfo style quoting
Quoted 4 lines · Peter Maydell
Avoid texinfo style quoting with `...', because rST treats it as a syntax error. Use '...' instead, as we do in other doc comments. This looks OK in texinfo, and rST formats it as paired-quotation-marks.
It's kind of wrong in TexInfo; results in "Right single quotation mark" (U+2019) on both ends. But we're doing it this kind of wrong all over the place anyway, and the wrongness will go away when we switch to rST. Acceptable.
PATCH 14/29 qapi/block-core.json: Use explicit bulleted lists
In reply to Peter MaydellA JSON block comment like this:
Returns: nothing on success
If @node is not a valid block device, DeviceNotFound If @name is not found, GenericError with an explanation
renders in the HTML and manpage like this:
Returns: nothing on success If node is not a valid block device, DeviceNotFound If name is not found, GenericError with an explanation
because whitespace is not significant.
Use an actual bulleted list, so that the formatting is correct.
--- qapi/block-core.json | 108 +++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 54 deletions(-)
qapi/block-core.json +54 -54
@@ -1326,8 +1326,8 @@ # # @size: new image size in bytes # -# Returns: nothing on success -# If @device is not a valid block device, DeviceNotFound +# Returns: - nothing on success +# - If @device is not a valid block device, DeviceNotFound # # Since: 0.14.0 #
@@ -1510,8 +1510,8 @@ # # For the arguments, see the documentation of BlockdevSnapshotSync. # -# Returns: nothing on success -# If @device is not a valid block device, DeviceNotFound +# Returns: - nothing on success +# - If @device is not a valid block device, DeviceNotFound # # Since: 0.14.0 #
@@ -1586,9 +1586,8 @@ # when specifying the string or the image chain may # not be able to be reopened again. # -# Returns: Nothing on success -# -# If "device" does not exist or cannot be determined, DeviceNotFound +# Returns: - Nothing on success +# - If "device" does not exist or cannot be determined, DeviceNotFound # # Since: 2.1 ##
@@ -1674,9 +1673,9 @@ # list without user intervention. # Defaults to true. (Since 3.1) # -# Returns: Nothing on success -# If @device does not exist, DeviceNotFound -# Any other error returns a GenericError. +# Returns: - Nothing on success +# - If @device does not exist, DeviceNotFound +# - Any other error returns a GenericError. # # Since: 1.3 #
@@ -1704,8 +1703,8 @@ # The operation can be stopped before it has completed using the # block-job-cancel command. # -# Returns: nothing on success -# If @device is not a valid block device, GenericError +# Returns: - nothing on success +# - If @device is not a valid block device, GenericError # # Since: 1.6 #
@@ -1730,8 +1729,8 @@ # The operation can be stopped before it has completed using the # block-job-cancel command. # -# Returns: nothing on success -# If @device is not a valid block device, DeviceNotFound +# Returns: - nothing on success +# - If @device is not a valid block device, DeviceNotFound # # Since: 2.3 #
@@ -1925,8 +1924,8 @@ # format of the mirror image, default is to probe if mode='existing', # else the format of the source. # -# Returns: nothing on success -# If @device is not a valid block device, GenericError +# Returns: - nothing on success +# - If @device is not a valid block device, GenericError # # Since: 1.3 #
@@ -2097,9 +2096,9 @@ # # Create a dirty bitmap with a name on the node, and start tracking the writes. # -# Returns: nothing on success -# If @node is not a valid block device or node, DeviceNotFound -# If @name is already taken, GenericError with an explanation +# Returns: - nothing on success +# - If @node is not a valid block device or node, DeviceNotFound +# - If @name is already taken, GenericError with an explanation # # Since: 2.4 #
@@ -2120,10 +2119,10 @@ # with block-dirty-bitmap-add. If the bitmap is persistent, remove it from its # storage too. # -# Returns: nothing on success -# If @node is not a valid block device or node, DeviceNotFound -# If @name is not found, GenericError with an explanation -# if @name is frozen by an operation, GenericError +# Returns: - nothing on success +# - If @node is not a valid block device or node, DeviceNotFound +# - If @name is not found, GenericError with an explanation +# - if @name is frozen by an operation, GenericError # # Since: 2.4 #
@@ -2144,9 +2143,9 @@ # backup from this point in time forward will only backup clusters # modified after this clear operation. # -# Returns: nothing on success -# If @node is not a valid block device, DeviceNotFound -# If @name is not found, GenericError with an explanation +# Returns: - nothing on success +# - If @node is not a valid block device, DeviceNotFound +# - If @name is not found, GenericError with an explanation # # Since: 2.4 #
@@ -2165,9 +2164,9 @@ # # Enables a dirty bitmap so that it will begin tracking disk changes. # -# Returns: nothing on success -# If @node is not a valid block device, DeviceNotFound -# If @name is not found, GenericError with an explanation +# Returns: - nothing on success +# - If @node is not a valid block device, DeviceNotFound +# - If @name is not found, GenericError with an explanation # # Since: 4.0 #
@@ -2186,9 +2185,9 @@ # # Disables a dirty bitmap so that it will stop tracking disk changes. # -# Returns: nothing on success -# If @node is not a valid block device, DeviceNotFound -# If @name is not found, GenericError with an explanation +# Returns: - nothing on success +# - If @node is not a valid block device, DeviceNotFound +# - If @name is not found, GenericError with an explanation # # Since: 4.0 #
@@ -2215,11 +2214,11 @@ # of the source bitmaps. This can be used to achieve backup checkpoints, or in # simpler usages, to copy bitmaps. # -# Returns: nothing on success -# If @node is not a valid block device, DeviceNotFound -# If any bitmap in @bitmaps or @target is not found, GenericError -# If any of the bitmaps have different sizes or granularities, -# GenericError +# Returns: - nothing on success +# - If @node is not a valid block device, DeviceNotFound +# - If any bitmap in @bitmaps or @target is not found, GenericError +# - If any of the bitmaps have different sizes or granularities, +# GenericError # # Since: 4.0 #
@@ -2251,10 +2250,10 @@ # # Get bitmap SHA256. # -# Returns: BlockDirtyBitmapSha256 on success -# If @node is not a valid block device, DeviceNotFound -# If @name is not found or if hashing has failed, GenericError with an -# explanation +# Returns: - BlockDirtyBitmapSha256 on success +# - If @node is not a valid block device, DeviceNotFound +# - If @name is not found or if hashing has failed, GenericError with an +# explanation # # Since: 2.10 ##
@@ -2371,8 +2370,8 @@ # the device will be removed from its group and the rest of its # members will not be affected. The 'group' parameter is ignored. # -# Returns: Nothing on success -# If @device is not a valid block device, DeviceNotFound +# Returns: - Nothing on success +# - If @device is not a valid block device, DeviceNotFound # # Since: 1.1 #
@@ -2622,7 +2621,8 @@ # list without user intervention. # Defaults to true. (Since 3.1) # -# Returns: Nothing on success. If @device does not exist, DeviceNotFound. +# Returns: - Nothing on success. +# - If @device does not exist, DeviceNotFound. # # Since: 1.1 #
@@ -2656,8 +2656,8 @@ # @speed: the maximum speed, in bytes per second, or 0 for unlimited. # Defaults to 0. # -# Returns: Nothing on success -# If no background operation is active on this device, DeviceNotActive +# Returns: - Nothing on success +# - If no background operation is active on this device, DeviceNotActive # # Since: 1.1 ##
@@ -2696,8 +2696,8 @@ # abandon the job immediately (even if it is paused) instead of waiting # for the destination to complete its final synchronization (since 1.3) # -# Returns: Nothing on success -# If no background operation is active on this device, DeviceNotActive +# Returns: - Nothing on success +# - If no background operation is active on this device, DeviceNotActive # # Since: 1.1 ##
@@ -2720,8 +2720,8 @@ # the name of the parameter), but since QEMU 2.7 it can have # other values. # -# Returns: Nothing on success -# If no background operation is active on this device, DeviceNotActive +# Returns: - Nothing on success +# - If no background operation is active on this device, DeviceNotActive # # Since: 1.3 ##
@@ -2742,8 +2742,8 @@ # the name of the parameter), but since QEMU 2.7 it can have # other values. # -# Returns: Nothing on success -# If no background operation is active on this device, DeviceNotActive +# Returns: - Nothing on success +# - If no background operation is active on this device, DeviceNotActive # # Since: 1.3 ##
@@ -2770,8 +2770,8 @@ # the name of the parameter), but since QEMU 2.7 it can have # other values. # -# Returns: Nothing on success -# If no background operation is active on this device, DeviceNotActive +# Returns: - Nothing on success +# - If no background operation is active on this device, DeviceNotActive # # Since: 1.3 ##
Signature · 1 line
2.20.1
Re: [PATCH 14/29] qapi/block-core.json: Use explicit bulleted lists
Quoted 11 lines · Peter Maydell
A JSON block comment like this:
Returns: nothing on success
If @node is not a valid block device, DeviceNotFound If @name is not found, GenericError with an explanationrenders in the HTML and manpage like this:
Returns: nothing on success If node is not a valid block device, DeviceNotFound If name is not found, GenericError with an explanation
because whitespace is not significant.
Pretty much the same in plain text and PDF. Unsurprising, as all are generated from the same, flawed TexInfo. Suggest "renders like this".
Quoted 4 lines
Use an actual bulleted list, so that the formatting is correct.
Signed-off-by Peter Maydell <[email protected]>
PATCH 15/29 qapi/ui.json: Use explicit bulleted lists
In reply to Peter MaydellA JSON block comment like this:
Returns: nothing on success
If @node is not a valid block device, DeviceNotFound If @name is not found, GenericError with an explanation
renders in the HTML and manpage like this:
Returns: nothing on success If node is not a valid block device, DeviceNotFound If name is not found, GenericError with an explanation
because whitespace is not significant.
Use an actual bulleted list, so that the formatting is correct.
--- qapi/ui.json | 63 +++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 30 deletions(-)
qapi/ui.json +33 -30
@@ -12,8 +12,8 @@ # # Sets the password of a remote display session. # -# @protocol: 'vnc' to modify the VNC server password -# 'spice' to modify the Spice server password +# @protocol: - 'vnc' to modify the VNC server password +# - 'spice' to modify the Spice server password # # @password: the new password #
@@ -23,8 +23,8 @@ # 'disconnect' to disconnect existing clients # 'keep' to maintain existing clients # -# Returns: Nothing on success -# If Spice is not enabled, DeviceNotFound +# Returns: - Nothing on success +# - If Spice is not enabled, DeviceNotFound # # Since: 0.14.0 #
@@ -46,13 +46,14 @@ # @protocol: the name of the remote display protocol 'vnc' or 'spice' # # @time: when to expire the password. -# 'now' to expire the password immediately -# 'never' to cancel password expiration -# '+INT' where INT is the number of seconds from now (integer) -# 'INT' where INT is the absolute time in seconds # -# Returns: Nothing on success -# If @protocol is 'spice' and Spice is not active, DeviceNotFound +# - 'now' to expire the password immediately +# - 'never' to cancel password expiration +# - '+INT' where INT is the number of seconds from now (integer) +# - 'INT' where INT is the absolute time in seconds +# +# Returns: - Nothing on success +# - If @protocol is 'spice' and Spice is not active, DeviceNotFound # # Since: 0.14.0 #
@@ -201,9 +202,10 @@ # @tls-port: The SPICE server's TLS port number. # # @auth: the current authentication type used by the server -# 'none' if no authentication is being used -# 'spice' uses SASL or direct TLS authentication, depending on command -# line options +# +# - 'none' if no authentication is being used +# - 'spice' uses SASL or direct TLS authentication, depending on command +# line options # # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can # be determined by the client or the server, or unknown if spice
@@ -433,27 +435,28 @@ # @host: The hostname the VNC server is bound to. This depends on # the name resolution on the host and may be an IP address. # -# @family: 'ipv6' if the host is listening for IPv6 connections -# 'ipv4' if the host is listening for IPv4 connections -# 'unix' if the host is listening on a unix domain socket -# 'unknown' otherwise +# @family: - 'ipv6' if the host is listening for IPv6 connections +# - 'ipv4' if the host is listening for IPv4 connections +# - 'unix' if the host is listening on a unix domain socket +# - 'unknown' otherwise # # @service: The service name of the server's port. This may depends # on the host system's service database so symbolic names should not # be relied on. # # @auth: the current authentication type used by the server -# 'none' if no authentication is being used -# 'vnc' if VNC authentication is being used -# 'vencrypt+plain' if VEncrypt is used with plain text authentication -# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication -# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication -# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth -# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth -# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth -# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth -# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth -# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth +# +# - 'none' if no authentication is being used +# - 'vnc' if VNC authentication is being used +# - 'vencrypt+plain' if VEncrypt is used with plain text authentication +# - 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication +# - 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication +# - 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth +# - 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth +# - 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth +# - 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth +# - 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth +# - 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth # # @clients: a list of @VncClientInfo of all currently connected clients #
@@ -841,8 +844,8 @@ # @hold-time: time to delay key up events, milliseconds. Defaults # to 100 # -# Returns: Nothing on success -# If key is unknown or redundant, InvalidParameter +# Returns: - Nothing on success +# - If key is unknown or redundant, InvalidParameter # # Since: 1.3.0 #
Signature · 1 line
2.20.1
PATCH 16/29 qapi/{block, misc, tmp}.json: Use explicit bulleted lists
In reply to Peter MaydellA JSON block comment like this:
Returns: nothing on success
If @node is not a valid block device, DeviceNotFound If @name is not found, GenericError with an explanation
renders in the HTML and manpage like this:
Returns: nothing on success If node is not a valid block device, DeviceNotFound If name is not found, GenericError with an explanation
because whitespace is not significant.
Use an actual bulleted list, so that the formatting is correct.
This commit gathers up the remaining json files which had places needing this fix.
--- qapi/block.json | 33 ++++++++++++++------------------- qapi/misc.json | 36 ++++++++++++++++-------------------- qapi/tpm.json | 4 ++-- 3 files changed, 32 insertions(+), 41 deletions(-)
qapi/block.json +14 -19
@@ -115,15 +115,12 @@ # # For the arguments, see the documentation of BlockdevSnapshotInternal. # -# Returns: nothing on success -# -# If @device is not a valid block device, GenericError -# -# If any snapshot matching @name exists, or @name is empty, -# GenericError -# -# If the format of the image used does not support it, -# BlockFormatFeatureNotSupported +# Returns: - nothing on success +# - If @device is not a valid block device, GenericError +# - If any snapshot matching @name exists, or @name is empty, +# GenericError +# - If the format of the image used does not support it, +# BlockFormatFeatureNotSupported # # Since: 1.7 #
@@ -154,12 +151,12 @@ # # @name: optional the snapshot's name to be deleted # -# Returns: SnapshotInfo on success -# If @device is not a valid block device, GenericError -# If snapshot not found, GenericError -# If the format of the image used does not support it, -# BlockFormatFeatureNotSupported -# If @id and @name are both not specified, GenericError +# Returns: - SnapshotInfo on success +# - If @device is not a valid block device, GenericError +# - If snapshot not found, GenericError +# - If the format of the image used does not support it, +# BlockFormatFeatureNotSupported +# - If @id and @name are both not specified, GenericError # # Since: 1.7 #
@@ -197,10 +194,8 @@ # @force: If true, eject regardless of whether the drive is locked. # If not specified, the default value is false. # -# Returns: Nothing on success -# -# If @device is not a valid block device, DeviceNotFound -# +# Returns: - Nothing on success +# - If @device is not a valid block device, DeviceNotFound # Notes: Ejecting a device with no media results in success # # Since: 0.14.0
qapi/misc.json +16 -20
@@ -418,12 +418,10 @@ # # Return information about the balloon device. # -# Returns: @BalloonInfo on success -# -# If the balloon driver is enabled but not functional because the KVM -# kernel module cannot support it, KvmMissingCap -# -# If no balloon device is present, DeviceNotActive +# Returns: - @BalloonInfo on success +# - If the balloon driver is enabled but not functional because the KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive # # Since: 0.14.0 #
@@ -480,8 +478,8 @@ # # @bar: the index of the Base Address Register for this region # -# @type: 'io' if the region is a PIO region -# 'memory' if the region is a MMIO region +# @type: - 'io' if the region is a PIO region +# - 'memory' if the region is a MMIO region # # @size: memory size #
@@ -992,10 +990,10 @@ # # @value: the target size of the balloon in bytes # -# Returns: Nothing on success -# If the balloon driver is enabled but not functional because the KVM +# Returns: - Nothing on success +# - If the balloon driver is enabled but not functional because the KVM # kernel module cannot support it, KvmMissingCap -# If no balloon device is present, DeviceNotActive +# - If no balloon device is present, DeviceNotActive # # Notes: This command just issues a request to the guest. When it returns, # the balloon size may not have changed. A guest can change the balloon
@@ -1074,8 +1072,8 @@ # If @device is 'vnc' and @target is 'password', this is the new VNC # password to set. See change-vnc-password for additional notes. # -# Returns: Nothing on success. -# If @device is not a valid block device, DeviceNotFound +# Returns: - Nothing on success. +# - If @device is not a valid block device, DeviceNotFound # # Notes: This interface is deprecated, and it is strongly recommended that you # avoid using it. For changing block devices, use
@@ -1225,11 +1223,9 @@ # # @opaque: A free-form string that can be used to describe the fd. # -# Returns: @AddfdInfo on success -# -# If file descriptor was not received, FdNotSupplied -# -# If @fdset-id is a negative value, InvalidParameterValue +# Returns: - @AddfdInfo on success +# - If file descriptor was not received, FdNotSupplied +# - If @fdset-id is a negative value, InvalidParameterValue # # Notes: The list of fd sets is shared by all monitor connections. #
@@ -1257,8 +1253,8 @@ # # @fd: The file descriptor that is to be removed. # -# Returns: Nothing on success -# If @fdset-id or @fd is not found, FdNotFound +# Returns: - Nothing on success +# - If @fdset-id or @fd is not found, FdNotFound # # Since: 1.2.0 #
qapi/tpm.json +2 -2
@@ -96,8 +96,8 @@ # # A union referencing different TPM backend types' configuration options # -# @type: 'passthrough' The configuration options for the TPM passthrough type -# 'emulator' The configuration options for TPM emulator backend type +# @type: - 'passthrough' The configuration options for the TPM passthrough type +# - 'emulator' The configuration options for TPM emulator backend type # # Since: 1.5 ##
Signature · 1 line
2.20.1
Re: [PATCH 16/29] qapi/{block, misc, tmp}.json: Use explicit bulleted lists
Quoted 171 lines · Peter Maydell
A JSON block comment like this:
Returns: nothing on success
If @node is not a valid block device, DeviceNotFound If @name is not found, GenericError with an explanationrenders in the HTML and manpage like this:
Returns: nothing on success If node is not a valid block device, DeviceNotFound If name is not found, GenericError with an explanation
because whitespace is not significant.
Use an actual bulleted list, so that the formatting is correct.
This commit gathers up the remaining json files which had places needing this fix.
Signed-off-by Peter Maydell <[email protected]>--- qapi/block.json | 33 ++++++++++++++------------------- qapi/misc.json | 36 ++++++++++++++++-------------------- qapi/tpm.json | 4 ++-- 3 files changed, 32 insertions(+), 41 deletions(-)qapi/block.json +14
-19@@ -115,15 +115,12 @@ # # For the arguments, see the documentation of BlockdevSnapshotInternal. # -# Returns: nothing on success -# -# If @device is not a valid block device, GenericError -# -# If any snapshot matching @name exists, or @name is empty, -# GenericError -# -# If the format of the image used does not support it, -# BlockFormatFeatureNotSupported +# Returns: - nothing on success +# - If @device is not a valid block device, GenericError +# - If any snapshot matching @name exists, or @name is empty, +# GenericError +# - If the format of the image used does not support it, +# BlockFormatFeatureNotSupported # # Since: 1.7 #@@ -154,12 +151,12 @@ # # @name: optional the snapshot's name to be deleted # -# Returns: SnapshotInfo on success -# If @device is not a valid block device, GenericError -# If snapshot not found, GenericError -# If the format of the image used does not support it, -# BlockFormatFeatureNotSupported -# If @id and @name are both not specified, GenericError +# Returns: - SnapshotInfo on success +# - If @device is not a valid block device, GenericError +# - If snapshot not found, GenericError +# - If the format of the image used does not support it, +# BlockFormatFeatureNotSupported +# - If @id and @name are both not specified, GenericError # # Since: 1.7 #@@ -197,10 +194,8 @@ # @force: If true, eject regardless of whether the drive is locked. # If not specified, the default value is false. # -# Returns: Nothing on success -# -# If @device is not a valid block device, DeviceNotFound -# +# Returns: - Nothing on success +# - If @device is not a valid block device, DeviceNotFound # Notes: Ejecting a device with no media results in success # # Since: 0.14.0qapi/misc.json +16
-20@@ -418,12 +418,10 @@ # # Return information about the balloon device. # -# Returns: @BalloonInfo on success -# -# If the balloon driver is enabled but not functional because the KVM -# kernel module cannot support it, KvmMissingCap -# -# If no balloon device is present, DeviceNotActive +# Returns: - @BalloonInfo on success +# - If the balloon driver is enabled but not functional because the KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive # # Since: 0.14.0 #@@ -480,8 +478,8 @@ # # @bar: the index of the Base Address Register for this region # -# @type: 'io' if the region is a PIO region -# 'memory' if the region is a MMIO region +# @type: - 'io' if the region is a PIO region +# - 'memory' if the region is a MMIO region # # @size: memory size #@@ -992,10 +990,10 @@ # # @value: the target size of the balloon in bytes # -# Returns: Nothing on success -# If the balloon driver is enabled but not functional because the KVM +# Returns: - Nothing on success +# - If the balloon driver is enabled but not functional because the KVM # kernel module cannot support it, KvmMissingCap -# If no balloon device is present, DeviceNotActive +# - If no balloon device is present, DeviceNotActive # # Notes: This command just issues a request to the guest. When it returns, # the balloon size may not have changed. A guest can change the balloon@@ -1074,8 +1072,8 @@ # If @device is 'vnc' and @target is 'password', this is the new VNC # password to set. See change-vnc-password for additional notes. # -# Returns: Nothing on success. -# If @device is not a valid block device, DeviceNotFound +# Returns: - Nothing on success. +# - If @device is not a valid block device, DeviceNotFound # # Notes: This interface is deprecated, and it is strongly recommended that you # avoid using it. For changing block devices, use@@ -1225,11 +1223,9 @@ # # @opaque: A free-form string that can be used to describe the fd. # -# Returns: @AddfdInfo on success -# -# If file descriptor was not received, FdNotSupplied -# -# If @fdset-id is a negative value, InvalidParameterValue +# Returns: - @AddfdInfo on success +# - If file descriptor was not received, FdNotSupplied +# - If @fdset-id is a negative value, InvalidParameterValue # # Notes: The list of fd sets is shared by all monitor connections. #@@ -1257,8 +1253,8 @@ # # @fd: The file descriptor that is to be removed. # -# Returns: Nothing on success -# If @fdset-id or @fd is not found, FdNotFound +# Returns: - Nothing on success +# - If @fdset-id or @fd is not found, FdNotFound # # Since: 1.2.0 #qapi/tpm.json +0
-0
qapi/tpm.json line 103
Quoted 10 lines
qapi/tpm.json +2
-2@@ -96,8 +96,8 @@ # # A union referencing different TPM backend types' configuration options # -# @type: 'passthrough' The configuration options for the TPM passthrough type -# 'emulator' The configuration options for TPM emulator backend type +# @type: - 'passthrough' The configuration options for the TPM passthrough type +# - 'emulator' The configuration options for TPM emulator backend type # # Since: 1.5 ##
PATCH 17/29 qapi: Add blank lines before bulleted lists
In reply to Peter MaydellrST insists on a blank line before and after a bulleted list, but our texinfo doc generator did not. Add some extra blank lines in the doc comments so they're acceptable rST input.
--- qapi/block-core.json | 1 + qapi/char.json | 2 ++ qapi/trace.json | 1 + qapi/ui.json | 1 + 4 files changed, 5 insertions(+)
qapi/block-core.json +1 -0
@@ -4757,6 +4757,7 @@ # # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in # which no such event will be generated, these include: +# # - if the guest has locked the tray, @force is false and the guest does not # respond to the eject request # - if the BlockBackend denoted by @device does not have a guest device attached
qapi/char.json +2 -0
@@ -133,6 +133,7 @@ # @data: data to write # # @format: data encoding (default 'utf8'). +# # - base64: data must be base64 encoded text. Its binary # decoding gets written. # - utf8: data's UTF-8 encoding is written
@@ -167,6 +168,7 @@ # @size: how many bytes to read at most # # @format: data encoding (default 'utf8'). +# # - base64: the data read is returned in base64 encoding. # - utf8: the data read is interpreted as UTF-8. # Bug: can screw up when the buffer contains invalid UTF-8
qapi/trace.json +1 -0
@@ -53,6 +53,7 @@ # Returns: a list of @TraceEventInfo for the matching events # # An event is returned if: +# # - its name matches the @name pattern, and # - if @vcpu is given, the event has the "vcpu" property. #
qapi/ui.json +1 -0
@@ -935,6 +935,7 @@ # Input event union. # # @type: the input type, one of: +# # - 'key': Input event of Keyboard # - 'btn': Input event of pointer buttons # - 'rel': Input event of relative pointer motion
Signature · 1 line
2.20.1
Re: [PATCH 17/29] qapi: Add blank lines before bulleted lists
Quoted 62 lines · Peter Maydell
rST insists on a blank line before and after a bulleted list, but our texinfo doc generator did not. Add some extra blank lines in the doc comments so they're acceptable rST input.
Signed-off-by Peter Maydell <[email protected]>--- qapi/block-core.json | 1 + qapi/char.json | 2 ++ qapi/trace.json | 1 + qapi/ui.json | 1 + 4 files changed, 5 insertions(+)qapi/block-core.json +1
-0@@ -4757,6 +4757,7 @@ # # Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in # which no such event will be generated, these include: +# # - if the guest has locked the tray, @force is false and the guest does not # respond to the eject request # - if the BlockBackend denoted by @device does not have a guest device attachedqapi/char.json +2
-0@@ -133,6 +133,7 @@ # @data: data to write # # @format: data encoding (default 'utf8'). +# # - base64: data must be base64 encoded text. Its binary # decoding gets written. # - utf8: data's UTF-8 encoding is written@@ -167,6 +168,7 @@ # @size: how many bytes to read at most # # @format: data encoding (default 'utf8'). +# # - base64: the data read is returned in base64 encoding. # - utf8: the data read is interpreted as UTF-8. # Bug: can screw up when the buffer contains invalid UTF-8qapi/trace.json +1
-0@@ -53,6 +53,7 @@ # Returns: a list of @TraceEventInfo for the matching events # # An event is returned if: +# # - its name matches the @name pattern, and # - if @vcpu is given, the event has the "vcpu" property. #qapi/ui.json +0
-0
qapi/ui.json line 941
Quoted 7 lines
qapi/ui.json +1
-0@@ -935,6 +935,7 @@ # Input event union. # # @type: the input type, one of: +# # - 'key': Input event of Keyboard # - 'btn': Input event of pointer buttons # - 'rel': Input event of relative pointer motion
PATCH 18/29 qapi/migration.json: Replace _this_ with *this*
In reply to Peter MaydellThe MigrationInfo::setup-time documentation is the only place where we use _this_ inline markup to mean italics. rST doesn't recognize that markup and emits literal underscores. Switch to *this* instead; for the texinfo output this will be bold, and for rST it will go back to being italics.
--- qapi/migration.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qapi/migration.json +2 -2
@@ -178,8 +178,8 @@ # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # -# @setup-time: amount of setup time in milliseconds _before_ the -# iterations begin but _after_ the QMP command is issued. This is designed +# @setup-time: amount of setup time in milliseconds *before* the +# iterations begin but *after* the QMP command is issued. This is designed # to provide an accounting of any activities (such as RDMA pinning) which # may be expensive, but do not actually occur during the iterative # migration rounds themselves. (since 1.6)
Signature · 1 line
2.20.1
Re: [PATCH 18/29] qapi/migration.json: Replace _this_ with *this*
Quoted 2 lines · Peter Maydell
The MigrationInfo::setup-time documentation is the only place where we use _this_ inline markup to mean italics.
Nitpick: _this_ does not mean italics, it means emphasis. See qapi-code-gen.txt section "Documentation markup". doc.py maps it to @emph{this}, which Texinfo commonly renders in italics when the output format supports that.
Quoted 4 lines
rST doesn't recognize
that markup and emits literal underscores. Switch to *this* instead; for the texinfo output this will be bold, and for rST it will go back to being italics.
Likewise, *this* doesn't mean italics in rST, it means emphasis.
With the Texinfo doc pipeline, the patch changes the markup of this from emphasis to strong.
The change will be undone when we switch to rST, where it means emphasis again.
Quoted 11 lines
Signed-off-by Peter Maydell <[email protected]>--- qapi/migration.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)qapi/migration.json +0
-0
qapi/migration.json line 185
Quoted 10 lines
qapi/migration.json +2
-2@@ -178,8 +178,8 @@ # expected downtime in milliseconds for the guest in last walk # of the dirty bitmap. (since 1.3) # -# @setup-time: amount of setup time in milliseconds _before_ the -# iterations begin but _after_ the QMP command is issued. This is designed +# @setup-time: amount of setup time in milliseconds *before* the +# iterations begin but *after* the QMP command is issued. This is designed # to provide an accounting of any activities (such as RDMA pinning) which # may be expensive, but do not actually occur during the iterative # migration rounds themselves. (since 1.6)
I don't like the commit message, but that's not enough to withhold my
Re: [PATCH 18/29] qapi/migration.json: Replace _this_ with *this*
Quoted 10 lines · Markus Armbruster
Quoted 2 lines · Peter Maydell
The MigrationInfo::setup-time documentation is the only place where we use _this_ inline markup to mean italics.
Nitpick: _this_ does not mean italics, it means emphasis. See qapi-code-gen.txt section "Documentation markup".
doc.pymaps it to @emph{this}, which Texinfo commonly renders in italics when the output format supports that.
Yeah, I know. But to my mind nobody actually cares about "is this 'emphasis' or 'strong'", because those are pretty meaningless and are not very easy to distinguish semantically. What people actually care about is "how does this render", because bold and italics look noticeably different and if you're writing you might care about which you get. At that point 'strong' is just a confusing synonym for 'bold' and 'emphasis' is a confusing synonym for 'italics'. But maybe I'm out on a limb here.
Anyway, I'm happy to tweak the commit message.
thanks
-- PMM
Re: [PATCH 18/29] qapi/migration.json: Replace _this_ with *this*
Quoted 21 lines · Peter Maydell
Quoted 10 lines · Markus Armbruster
Quoted 2 lines · Peter Maydell
The MigrationInfo::setup-time documentation is the only place where we use _this_ inline markup to mean italics.
Nitpick: _this_ does not mean italics, it means emphasis. See qapi-code-gen.txt section "Documentation markup".
doc.pymaps it to @emph{this}, which Texinfo commonly renders in italics when the output format supports that.Yeah, I know. But to my mind nobody actually cares about "is this 'emphasis' or 'strong'", because those are pretty meaningless and are not very easy to distinguish semantically. What people actually care about is "how does this render", because bold and italics look noticeably different and if you're writing you might care about which you get. At that point 'strong' is just a confusing synonym for 'bold' and 'emphasis' is a confusing synonym for 'italics'. But maybe I'm out on a limb here.
Quoted 1 line
Anyway, I'm happy to tweak the commit message.
What about this:
qapi/migration.json: Replace _this_ with *this*
The MigrationInfo::setup-time documentation is the only place where we use _this_ inline markup for emphasis, commonly rendered in italics. rST doesn't recognize that markup and emits literal underscores.
Switch to *this* instead. Changes markup to strong emphasis with Texinfo, commonly rendered as bold. With rST, it will go right back to emphasis / italics.
I tried to cater both for semantic markup wonks and happy visual ignorants ;)
PATCH 19/29 qapi/qapi-schema.json: Put headers in their own doc-comment blocks
In reply to Peter MaydellOur current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in any documentation comment. This works for texinfo because the texi generator simply prints a texinfo heading directive at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there.
New section headings in the middle of the documentation of a command or event would be pretty nonsensical, and in fact we only ever output new headings using 'freeform' doc comment blocks whose only content is the single line of the heading, with two exceptions, which are in the introductory freeform-doc-block at the top of qapi/qapi-schema.json.
Split that doc-comment up so that the heading lines are in their own doc-comment. This will allow us to tighten the specification to insist that heading lines are always standalone, rather than requiring the rST document generator to look at every line in a doc comment block and handle headings in odd places.
This change makes no difference to the generated texi.
--- qapi/qapi-schema.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
qapi/qapi-schema.json +9 -3
@@ -1,7 +1,9 @@ # -*- Mode: Python -*- ## # = Introduction -# +## + +## # This document describes all commands currently supported by QMP. # # Most of the time their usage is exactly the same as in the user Monitor, this
@@ -25,9 +27,13 @@ # # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for # detailed information on the Server command and response formats. -# +## + +## # = Stability Considerations -# +## + +## # The current QMP command set (described in this file) may be useful for a # number of use cases, however it's limited and several commands have bad # defined semantics, specially with regard to command completion.
Signature · 1 line
2.20.1
Re: [PATCH 19/29] qapi/qapi-schema.json: Put headers in their own doc-comment blocks
Quoted 50 lines · Peter Maydell
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in any documentation comment. This works for texinfo because the texi generator simply prints a texinfo heading directive at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there.
New section headings in the middle of the documentation of a command or event would be pretty nonsensical, and in fact we only ever output new headings using 'freeform' doc comment blocks whose only content is the single line of the heading, with two exceptions, which are in the introductory freeform-doc-block at the top of
qapi/qapi-schema.json.Split that doc-comment up so that the heading lines are in their own doc-comment. This will allow us to tighten the specification to insist that heading lines are always standalone, rather than requiring the rST document generator to look at every line in a doc comment block and handle headings in odd places.
This change makes no difference to the generated texi.
Signed-off-by Peter Maydell <[email protected]>--- qapi/qapi-schema.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)qapi/qapi-schema.json +4
-2@@ -1,7 +1,9 @@ # -*- Mode: Python -*- ## # = Introduction -# +## + +## # This document describes all commands currently supported by QMP. # # Most of the time their usage is exactly the same as in the user Monitor, this@@ -25,9 +27,13 @@ # # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for # detailed information on the Server command and response formats. -# +##
qapi/qapi-schema.json line 39
Quoted 10 lines
qapi/qapi-schema.json +5
-1+ +## # = Stability Considerations -# +## + +## # The current QMP command set (described in this file) may be useful for a # number of use cases, however it's limited and several commands have bad # defined semantics, specially with regard to command completion.
I figure this is a minimally invasive patch to avoid complications in your rST generator. I'm afraid it sweeps the actual problem under the rug, namely flaws in our parsing and representation of doc comments.
The doc comment parser doesn't recognize headings. Instead, that's done somewhere in the bowels of the Texinfo generator. Works as long as the input is "sane", happily generates invalid Texinfo otherwise, see tests/qapi-schema/doc-bad-section.json.
The proper fix is to make the parser recognize headers in the places where headers make sense, and reject them elsewhere.
But maybe we don't have to. Do you plan to support full rST in doc comments? If yes, why have our own syntax for headings? Why not leave it to rST? If no, do you plan to support a subset of rST? If yes, define it, please. How will it be enforced?
Re: [PATCH 19/29] qapi/qapi-schema.json: Put headers in their own doc-comment blocks
Quoted 34 lines · Markus Armbruster
Quoted 16 lines · Peter Maydell
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in any documentation comment. This works for texinfo because the texi generator simply prints a texinfo heading directive at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there.
New section headings in the middle of the documentation of a command or event would be pretty nonsensical, and in fact we only ever output new headings using 'freeform' doc comment blocks whose only content is the single line of the heading, with two exceptions, which are in the introductory freeform-doc-block at the top of
qapi/qapi-schema.json.Quoted 5 lines
Split that doc-comment up so that the heading lines are in their own doc-comment. This will allow us to tighten the specification to insist that heading lines are always standalone, rather than requiring the rST document generator to look at every line in a doc comment block and handle headings in odd places.
I figure this is a minimally invasive patch to avoid complications in your rST generator. I'm afraid it sweeps the actual problem under the rug, namely flaws in our parsing and representation of doc comments.
The doc comment parser doesn't recognize headings. Instead, that's done somewhere in the bowels of the Texinfo generator. Works as long as the input is "sane", happily generates invalid Texinfo otherwise, see
tests/qapi-schema/doc-bad-section.json.
Quoted 7 lines
The proper fix is to make the parser recognize headers in the places where headers make sense, and reject them elsewhere.
But maybe we don't have to. Do you plan to support full rST in doc comments? If yes, why have our own syntax for headings? Why not leave it to rST? If no, do you plan to support a subset of rST? If yes, define it, please. How will it be enforced?
Doc comments do support full rST. However, (as the commit message here notes), if you're generating a tree of docutils nodes and one of them has a section heading in it then you'll get a result that looks like this:
[root]
- [ some section created by the script for a QAPI command ]
- [ some section ]
- [text nodes, etc going into this section]
- [a section resulting from rST parsing the header inside the docstring]
- [ next section created by the script for a QAPI command ]
(ie you'll have defined a subsection within whatever document paragraph/section the current command is documenting, not a new top-level subsection which subsequent commands will become children of)
What you actually want is that the new header results in
a differently structured tree:
[root]
- [ some section created by the script for a QAPI command ]
- [ some section ]
- [text nodes, etc going into this section]
- [ a new top level section whose header is whatever this header is ]
- [ next section created by the script is a child of that section ]
- [ etc ]
There's no way to get that without actually noticing and handling headings specially as being something entirely different from a lump of documentation text. "A heading is a single-line special-case of a freeform comment" happens to be the way we mark up headings now in 99% of cases, so that's what I implemented. (The Sphinx extension will complain if there's trailing junk lines after a heading line at the beginning of a freeform comment block. If you use '== something' in a line in the middle of a doc comment, we'll just interpret that as rST source, which is to say a couple of literal equals signs at the start of a line.)
thanks
-- PMM
Re: [PATCH 19/29] qapi/qapi-schema.json: Put headers in their own doc-comment blocks
Quoted 70 lines · Peter Maydell
Quoted 34 lines · Markus Armbruster
Quoted 16 lines · Peter Maydell
Our current QAPI doc-comment markup allows section headers (introduced with a leading '=' or '==') anywhere in any documentation comment. This works for texinfo because the texi generator simply prints a texinfo heading directive at that point in the output stream. For rST generation, since we're assembling a tree of docutils nodes, this is awkward because a new section implies starting a new section node at the top level of the tree and generating text into there.
New section headings in the middle of the documentation of a command or event would be pretty nonsensical, and in fact we only ever output new headings using 'freeform' doc comment blocks whose only content is the single line of the heading, with two exceptions, which are in the introductory freeform-doc-block at the top of
qapi/qapi-schema.json.Quoted 5 lines
Split that doc-comment up so that the heading lines are in their own doc-comment. This will allow us to tighten the specification to insist that heading lines are always standalone, rather than requiring the rST document generator to look at every line in a doc comment block and handle headings in odd places.
I figure this is a minimally invasive patch to avoid complications in your rST generator. I'm afraid it sweeps the actual problem under the rug, namely flaws in our parsing and representation of doc comments.
The doc comment parser doesn't recognize headings. Instead, that's done somewhere in the bowels of the Texinfo generator. Works as long as the input is "sane", happily generates invalid Texinfo otherwise, see
tests/qapi-schema/doc-bad-section.json.Quoted 7 lines
The proper fix is to make the parser recognize headers in the places where headers make sense, and reject them elsewhere.
But maybe we don't have to. Do you plan to support full rST in doc comments? If yes, why have our own syntax for headings? Why not leave it to rST? If no, do you plan to support a subset of rST? If yes, define it, please. How will it be enforced?
Doc comments do support full rST. However, (as the commit message here notes), if you're generating a tree of docutils nodes and one of them has a section heading in it then you'll get a result that looks like this:
[root]
- [ some section created by the script for a QAPI command ]
- [ some section ]
- [text nodes, etc going into this section]
- [a section resulting from rST parsing the header inside the docstring]
- [ next section created by the script for a QAPI command ](ie you'll have defined a subsection within whatever document paragraph/section the current command is documenting, not a new top-level subsection which subsequent commands will become children of)
What you actually want is that the new header results in
a differently structured tree:
[root]
- [ some section created by the script for a QAPI command ]
- [ some section ]
- [text nodes, etc going into this section]
- [ a new top level section whose header is whatever this header is ]
- [ next section created by the script is a child of that section ]
- [ etc ]
Quoted 10 lines
There's no way to get that without actually noticing and handling headings specially as being something entirely different from a lump of documentation text. "A heading is a single-line special-case of a freeform comment" happens to be the way we mark up headings now in 99% of cases, so that's what I implemented. (The Sphinx extension will complain if there's trailing junk lines after a heading line at the beginning of a freeform comment block. If you use '== something' in a line in the middle of a doc comment, we'll just interpret that as rST source, which is to say a couple of literal equals signs at the start of a line.)
A couple of remarks.
Silently passing a "# == something" line to rST for literal (mis-)interpretation is not nice. It's the kind of indifference that led to the messes you cleaned up in PATCH 04 and 08. If the '=' markup is only valid in certain places, it should be rejected where it isn't.
By refusing to translate "# == something" to rST (silently or loudly, doesn't matter), the first tree structure becomes impossible. Except when I do the translating myself: I can put an *rST* section wherever I want.
I'm still having difficulties understanding what exactly we gain by translating '=' markup to rST.
By the way, your implementation rejects
##
# = Introduction
# xxx
##but silently accepts
##
# xxx
# = Introduction
##doc-good.json has more instances of this issue. Before your series, we actually check we generate the Texinfo we expect for it. I can't find where you cover this now. It has saved me from my screwups more than once, so I don't want to lose that.
Now let's put my doubts and your possible bugs / omissions aside and assume we want '=' markup, and we want to keep the resulting sections out of "sections created by the script for a QAPI command".
A schema's documentation is a sequence of comment blocks.
Each comment block is either a definition comment block or a free form comment block.
Before your series, we recognize '=' markup everywhere, but that's basically wrong (see "flaws in our parsing and representation of doc comments" above). It should be accepted only in free-form comment blocks.
That way, the free-form comment blocks build a section structure, and the definition comment blocks slot their stuff into this structure.
Form a language design perspective, I can't see the need for restricting '=' further to occur only by themselves.
Is it an issue of implementation perhaps?
Re: [PATCH 19/29] qapi/qapi-schema.json: Put headers in their own doc-comment blocks
Quoted 7 lines · Markus Armbruster
A couple of remarks.
Silently passing a "# == something" line to rST for literal (mis-)interpretation is not nice. It's the kind of indifference that led to the messes you cleaned up in PATCH 04 and 08. If the '=' markup is only valid in certain places, it should be rejected where it isn't.
Quoted 7 lines
By refusing to translate "# == something" to rST (silently or loudly, doesn't matter), the first tree structure becomes impossible. Except when I do the translating myself: I can put an *rST* section wherever I want.
I'm still having difficulties understanding what exactly we gain by translating '=' markup to rST.
We don't translate '=' markup to rST. We use it as the way the input document tells us about the structure of the tree of docutils sections it wants us to create. No rST markup is ever involved in that process.
If we wanted to do something with '# == something' in actual chunks of doc comment, we would have to specifically scan the doc comment for that. Currently we simply pass doc comments to the rST parser to be parsed. Then you have to document the syntax of a doc comment as "rST, except that as a special case a line starting == doesn't do what it does in normal rST text but is a syntax error".
What I would like is:
* doc comments are simply rST, and we interpret them as rST by passing them directly to the rST parser. (We do special case the "@var means ``var``" markup, but I would rather keep to a minimum the number of things we special case in that way.)
* headings and subheadings affect the entire document structure; they are not rST source and are never interpreted as rST source or sent to the rST parser. They are a thing all of their own, not a bit of markup within a larger doc comment.
* not to gratuitously change the way we in practice mark up headings in our document, because that makes the texi->rST transition harder for no clear gain. If we absolutely must mark them up in some other way than we do today, I can implement that, but it feels like unnecessary work.
Quoted 7 lines
By the way, your implementation rejects
## # = Introduction # xxx ##
Quoted 6 lines
but silently accepts
## # xxx # = Introduction ##
Yes. I could treat all freeform comments that aren't the special one-line heading/subheading as being normal freeform comments, which would avoid this inconsistency. That's probably better.
Quoted 4 lines
doc-good.json has more instances of this issue. Before your series, we actually check we generate the Texinfo we expect for it. I can't find where you cover this now. It has saved me from my screwups more than once, so I don't want to lose that.
Yes, we no longer have a test case for "do we generate what we expect to". That's harder to do with a Sphinx extension because we don't ever output rST source anywhere that we could compare to an expected version. (We still have the existing tests that the doc comments spit out by parser.py match expected output.) I'm dubious about running Sphinx and comparing the generated HTML because that seems like it would be vulnerable to test failures if Sphinx internals change the fine detail of how it outputs HTML.
Quoted 14 lines
Now let's put my doubts and your possible bugs / omissions aside and assume we want '=' markup, and we want to keep the resulting sections out of "sections created by the script for a QAPI command".
A schema's documentation is a sequence of comment blocks.
Each comment block is either a definition comment block or a free form comment block.
Before your series, we recognize '=' markup everywhere, but that's basically wrong (see "flaws in our parsing and representation of doc comments" above). It should be accepted only in free-form comment blocks.
Quoted 7 lines
That way, the free-form comment blocks build a section structure, and the definition comment blocks slot their stuff into this structure.
Form a language design perspective, I can't see the need for restricting '=' further to occur only by themselves.
Is it an issue of implementation perhaps?
Do you mean: could we make the implementation take a freeform comment block like:
##
# = Foo
#
# Some text
#
# = Bar
#
# More text
##
and parse through that text to split it up into
- "start new level-1 section with heading 'Foo'"
- "a freeform comment block '\nSome text\n\n'" (for current section)
- "start new level-1 section with heading 'Bar'"
- "a freeform comment block '\nMore text\n\n'" (for current section)
so that the input rST doesn't need to mark off the headings as being in their own freeform comment block ?
Yes, we could do that, and it wouldn't be too hard. My issues with that are:
(1) you now don't have a way to literally write '= Foo' to be interpreted the way that rST would interpret it in a comment block that's otherwise just "any rST markup is fine".
(2) it falsely suggests that headings are OK in doc comment blocks and are just another kind of markup within a doc comment, when they aren't, and we're really just providing syntactic sugar here
(3) it obscures the actual structure of the
document, which is
[root node]
[section]
[title 'Foo']
[Text 'Some text']
[section]
[title 'Bar']
[Text 'More text']
where "Some text" and "More text" are in entirely different sections, even though they're in the same doc comment block. (If 'Foo' is a subsection and 'Bar' a section, the text can end up even further separated within the document tree.)
(4) it breaks a general approach within the handling of doc comments, which is that we build the document based on the various bits of information about the symbol, etc, but a chunk of text from a document comment is handled simply by handing it off to the rST parser, not by doing some script-specific pre-parsing and mangling of it and then handing it to the rST parser. This in turn means that we need to document the syntax of comment blocks as not just "it's rST with the @var-means-``var`` extra" but "it's rST, with @var-means-``var``, and = Foo is invalid most places but within a freeform block means this other thing". I think that minimising the number of extras we add on top of "the syntax for a block of text in a doc comment is rST" makes things less confusing.
thanks
-- PMM
PATCH 20/29 qapi/machine.json: Escape a literal '*' in doc comment
In reply to Peter MaydellFor rST, '*' is a kind of inline markup (for emphasis), so "*-softmmu" is a syntax error because of the missing closing '*'. Escape the '*' with a '\'.
The texinfo document generator will leave the '\' in the output, which is not ideal, but that generator is going to go away in a subsequent commit.
--- qapi/machine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qapi/machine.json +1 -1
@@ -12,7 +12,7 @@ # # The comprehensive enumeration of QEMU system emulation ("softmmu") # targets. Run "./configure --help" in the project root directory, and -# look for the *-softmmu targets near the "--target-list" option. The +# look for the \*-softmmu targets near the "--target-list" option. The # individual target constants are not documented here, for the time # being. #
Signature · 1 line
2.20.1
PATCH 21/29 scripts/qapi: Move doc-comment whitespace stripping to doc.py
In reply to Peter MaydellAs we accumulate lines from doc comments when parsing the JSON, the QAPIDoc class generally strips leading and trailing whitespace using line.strip() when it calls _append_freeform(). This is fine for texinfo, but for rST leading whitespace is significant. We'd like to move to having the text in doc comments be rST format rather than a custom syntax, so move the removal of leading whitespace from the QAPIDoc class to the texinfo-specific processing code in texi_format() in qapi/doc.py.
(Trailing whitespace will always be stripped by the rstrip() in Section::append regardless.)
In a followup commit we will make the whitespace in the lines of doc comment sections more consistently follow the input source.
There is no change to the generated .texi files before and after this commit.
--- scripts/qapi/doc.py | 1 + scripts/qapi/parser.py | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-)
scripts/qapi/doc.py +1 -0
@@ -80,6 +80,7 @@ def texi_format(doc): inlist = '' lastempty = False for line in doc.split('\n'): + line = line.strip() empty = line == '' # FIXME: Doing this in a single if / elif chain is
scripts/qapi/parser.py +4 -8
@@ -422,10 +422,10 @@ class QAPIDoc(object): self._append_line = self._append_various_line self._append_various_line(line) else: - self._append_freeform(line.strip()) + self._append_freeform(line) else: # This is a free-form documentation block - self._append_freeform(line.strip()) + self._append_freeform(line) def _append_args_line(self, line): """
@@ -458,7 +458,7 @@ class QAPIDoc(object): self._append_various_line(line) return - self._append_freeform(line.strip()) + self._append_freeform(line) def _append_features_line(self, line): name = line.split(' ', 1)[0]
@@ -477,7 +477,7 @@ class QAPIDoc(object): self._append_various_line(line) return - self._append_freeform(line.strip()) + self._append_freeform(line) def _append_various_line(self, line): """
@@ -500,10 +500,6 @@ class QAPIDoc(object): line = line[len(name)+1:] self._start_section(name[:-1]) - if (not self._section.name or - not self._section.name.startswith('Example')): - line = line.strip() - self._append_freeform(line) def _start_symbol_section(self, symbols_dict, name):
Signature · 1 line
2.20.1
PATCH 22/29 scripts/qapi/parser.py: improve doc comment indent handling
In reply to Peter MaydellMake the handling of indentation in doc comments more sophisticated, so that when we see a section like:
Notes: some text
some more text
indented line 3
we save it for the doc-comment processing code as:
some text
some more text
indented line 3
and when we see a section with the heading on its own line:
Notes:
some text
some more text
indented text
we also accept that and save it in the same form.
The exception is that we always retain indentation as-is for Examples sections, because these are literal text.
If we detect that the comment document text is not indented as much as we expect it to be, we throw a parse error. (We don't complain about over-indented sections, because for rST this can be legitimate markup.)
--- scripts/qapi/parser.py | 82 +++++++++++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 17 deletions(-)
scripts/qapi/parser.py +65 -17
@@ -313,18 +313,32 @@ class QAPIDoc(object): """ class Section(object): - def __init__(self, name=None): + def __init__(self, parser, name=None, indent=0): + # parser, for error messages about indentation + self._parser = parser # optional section name (argument/member or section name) self.name = name # the list of lines for this section self.text = '' + # the expected indent level of the text of this section + self._indent = indent def append(self, line): + # Strip leading spaces corresponding to the expected indent level + # Blank lines are always OK. + if line: + spacecount = len(line) - len(line.lstrip(" ")) + if spacecount > self._indent: + spacecount = self._indent + if spacecount < self._indent: + raise QAPIParseError(self._parser, "unexpected de-indent") + line = line[spacecount:] + self.text += line.rstrip() + '\n' class ArgSection(Section): - def __init__(self, name): - QAPIDoc.Section.__init__(self, name) + def __init__(self, parser, name, indent=0): + QAPIDoc.Section.__init__(self, parser, name, indent) self.member = None def connect(self, member):
@@ -338,7 +352,7 @@ class QAPIDoc(object): self._parser = parser self.info = info self.symbol = None - self.body = QAPIDoc.Section() + self.body = QAPIDoc.Section(parser) # dict mapping parameter name to ArgSection self.args = OrderedDict() self.features = OrderedDict()
@@ -443,7 +457,18 @@ class QAPIDoc(object): if name.startswith('@') and name.endswith(':'): line = line[len(name)+1:] - self._start_args_section(name[1:-1]) + if not line or line.isspace(): + # Line was just the "@arg:" header; following lines + # are not indented + indent = 0 + line = '' + else: + # Line is "@arg: first line of description"; following + # lines should be indented by len(name) + 1, and we + # pad out this first line so it is handled the same way + indent = len(name) + 1 + line = ' ' * indent + line + self._start_args_section(name[1:-1], indent) elif self._is_section_tag(name): self._append_line = self._append_various_line self._append_various_line(line)
@@ -465,7 +490,17 @@ class QAPIDoc(object): if name.startswith('@') and name.endswith(':'): line = line[len(name)+1:] - self._start_features_section(name[1:-1]) + if not line or line.isspace(): + # Line is just the "@name:" header, no ident for following lines + indent = 0 + line = '' + else: + # Line is "@arg: first line of description"; following + # lines should be indented by len(name) + 3, and we + # pad out this first line so it is handled the same way + indent = len(name) + 1 + line = ' ' * indent + line + self._start_features_section(name[1:-1], indent) elif self._is_section_tag(name): self._append_line = self._append_various_line self._append_various_line(line)
@@ -498,11 +533,23 @@ class QAPIDoc(object): % (name, self.sections[0].name)) elif self._is_section_tag(name): line = line[len(name)+1:] - self._start_section(name[:-1]) + if not line or line.isspace(): + # Line is just "SectionName:", no indent for following lines + indent = 0 + line = '' + elif name.startswith("Example"): + # The "Examples" section is literal-text, so preserve + # all the indentation as-is + indent = 0 + else: + # Line is "SectionName: some text", indent required + indent = len(name) + 1 + line = ' ' * indent + line + self._start_section(name[:-1], indent) self._append_freeform(line) - def _start_symbol_section(self, symbols_dict, name): + def _start_symbol_section(self, symbols_dict, name, indent): # FIXME invalid names other than the empty string aren't flagged if not name: raise QAPIParseError(self._parser, "invalid parameter name")
@@ -511,21 +558,21 @@ class QAPIDoc(object): "'%s' parameter name duplicated" % name) assert not self.sections self._end_section() - self._section = QAPIDoc.ArgSection(name) + self._section = QAPIDoc.ArgSection(self._parser, name, indent) symbols_dict[name] = self._section - def _start_args_section(self, name): - self._start_symbol_section(self.args, name) + def _start_args_section(self, name, indent): + self._start_symbol_section(self.args, name, indent) - def _start_features_section(self, name): - self._start_symbol_section(self.features, name) + def _start_features_section(self, name, indent): + self._start_symbol_section(self.features, name, indent) - def _start_section(self, name=None): + def _start_section(self, name=None, indent=0): if name in ('Returns', 'Since') and self.has_section(name): raise QAPIParseError(self._parser, "duplicated '%s' section" % name) self._end_section() - self._section = QAPIDoc.Section(name) + self._section = QAPIDoc.Section(self._parser, name, indent) self.sections.append(self._section) def _end_section(self):
@@ -548,7 +595,7 @@ class QAPIDoc(object): def connect_member(self, member): if member.name not in self.args: # Undocumented TODO outlaw - self.args[member.name] = QAPIDoc.ArgSection(member.name) + self.args[member.name] = QAPIDoc.ArgSection(self._parser, member.name) self.args[member.name].connect(member) def connect_feature(self, feature):
@@ -556,7 +603,8 @@ class QAPIDoc(object): raise QAPISemError(feature.info, "feature '%s' lacks documentation" % feature.name) - self.features[feature.name] = QAPIDoc.ArgSection(feature.name) + self.features[feature.name] = QAPIDoc.ArgSection(self._parser, + feature.name) self.features[feature.name].connect(feature) def check_expr(self, expr):
Signature · 1 line
2.20.1
PATCH 23/29 docs/sphinx: Add new qapi-doc Sphinx extension
In reply to Peter MaydellSome of our documentation is auto-generated from documentation comments in the JSON schema.
For Sphinx, rather than creating a file to include, the most natural way to handle this is to have a small custom Sphinx extension which processes the JSON file and inserts documentation into the rST file being processed.
This is the same approach that kerneldoc and hxtool use.
--- MAINTAINERS | 1 + docs/conf.py | 6 +- docs/sphinx/qapidoc.py | 504 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 510 insertions(+), 1 deletion(-) create mode 100644 docs/sphinx/qapidoc.py
MAINTAINERS +1 -0
@@ -2786,3 +2786,4 @@ M: Peter Maydell <[email protected]> S: Maintained F: docs/conf.py F: docs/*/conf.py +F: docs/sphinx/
docs/conf.py +5 -1
@@ -51,7 +51,10 @@ except NameError: # add these directories to sys.path here. If the directory is relative to the # documentation root, use an absolute path starting from qemu_docdir. # +# Our extensions are in docs/sphinx; the qapidoc extension requires +# the QAPI modules from scripts/. sys.path.insert(0, os.path.join(qemu_docdir, "sphinx")) +sys.path.insert(0, os.path.join(qemu_docdir, "../scripts")) # -- General configuration ------------------------------------------------
@@ -64,7 +67,7 @@ needs_sphinx = '1.3' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['kerneldoc', 'qmp_lexer', 'hxtool'] +extensions = ['kerneldoc', 'qmp_lexer', 'hxtool', 'qapidoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
@@ -232,3 +235,4 @@ texinfo_documents = [ kerneldoc_bin = os.path.join(qemu_docdir, '../scripts/kernel-doc') kerneldoc_srctree = os.path.join(qemu_docdir, '..') hxtool_srctree = os.path.join(qemu_docdir, '..') +qapidoc_srctree = os.path.join(qemu_docdir, '..')
docs/sphinx/qapidoc.py new file +504 -0
504 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 24/29 docs/interop: Convert qemu-ga-ref to rST
In reply to Peter MaydellConvert qemu-ga-ref to rST format. This includes dropping the plain-text, pdf and info format outputs for this document; as with all our other Sphinx-based documentation, we provide HTML and manpage only.
The qemu-ga-ref.rst is somewhat more stripped down than the .texi was, because we do not (currently) attempt to generate indexes for the commands, events and data types being documented.
As the GA ref is now part of the Sphinx 'interop' manual, we can delete the direct link from index.html.in.
--- Makefile | 42 ++++++++---------- MAINTAINERS | 2 +- docs/index.html.in | 1 - docs/interop/conf.py | 2 + docs/interop/index.rst | 1 + docs/interop/qemu-ga-ref.rst | 4 ++ docs/interop/qemu-ga-ref.texi | 80 ----------------------------------- 7 files changed, 25 insertions(+), 107 deletions(-) create mode 100644 docs/interop/qemu-ga-ref.rst delete mode 100644 docs/interop/qemu-ga-ref.texi
Makefile +17 -25
@@ -350,7 +350,7 @@ DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-nbd.8 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8 DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 -DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7 +DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga-ref.7 DOCS+=docs/qemu-cpu-models.7 DOCS+=$(MANUAL_BUILDDIR)/index.html ifdef CONFIG_VIRTFS
@@ -759,11 +759,11 @@ distclean: clean rm -f config.log rm -f linux-headers/asm rm -f docs/version.texi - rm -f docs/interop/qemu-ga-qapi.texi docs/interop/qemu-qmp-qapi.texi - rm -f docs/interop/qemu-qmp-ref.7 docs/interop/qemu-ga-ref.7 - rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt - rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf - rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html + rm -f docs/interop/qemu-qmp-qapi.texi + rm -f docs/interop/qemu-qmp-ref.7 + rm -f docs/interop/qemu-qmp-ref.txt + rm -f docs/interop/qemu-qmp-ref.pdf + rm -f docs/interop/qemu-qmp-ref.html rm -f docs/qemu-cpu-models.7 rm -rf .doctrees $(call clean-manual,devel)
@@ -817,7 +817,7 @@ endif # and also any sphinx-built manpages. define install-manual = for d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done -for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-*-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done +for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-qmp-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done endef # Note that we deliberately do not install the "devel" manual: it is
@@ -852,9 +852,7 @@ ifdef CONFIG_TRACE_SYSTEMTAP endif ifneq (,$(findstring qemu-ga,$(TOOLS))) $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" + $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" endif endif ifdef CONFIG_VIRTFS
@@ -1041,7 +1039,7 @@ endef $(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel) $(call build-manual,devel,html) -$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) $(SRC_PATH)/qemu-img-cmds.hx +$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) $(call build-manual,interop,html) $(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs)
@@ -1051,8 +1049,10 @@ $(MANUAL_BUILDDIR)/system/index.html: $(call manual-deps,system) $(call build-manual,system,html) $(call define-manpage-rule,interop,\ - qemu-ga.8 qemu-img.1 qemu-nbd.8 qemu-trace-stap.1 virtfs-proxy-helper.1,\ - $(SRC_PATH)/qemu-img-cmds.hx) + qemu-ga.8 qemu-ga-ref.7 \ + qemu-img.1 qemu-nbd.8 qemu-trace-stap.1 virtfs-proxy-helper.1,\ + $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/qga/qapi-schema.json \ + $(qapi-py)) $(call define-manpage-rule,system,qemu-block-drivers.7)
@@ -1073,17 +1073,14 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi @cp -p $< $@ -docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi - @cp -p $< $@ - qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi qemu.1: qemu-option-trace.texi docs/qemu-cpu-models.7: docs/qemu-cpu-models.texi -html: qemu-doc.html docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs -info: qemu-doc.info docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info -pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf -txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt +html: qemu-doc.html docs/interop/qemu-qmp-ref.html sphinxdocs +info: qemu-doc.info docs/interop/qemu-qmp-ref.info +pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf +txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-options.texi \
@@ -1092,11 +1089,6 @@ qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-monitor-info.texi \ docs/qemu-cpu-models.texi docs/security.texi -docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \ - docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \ - docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7: \ - docs/interop/qemu-ga-ref.texi docs/interop/qemu-ga-qapi.texi - docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \ docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \ docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \
MAINTAINERS +1 -1
@@ -2126,9 +2126,9 @@ M: Michael Roth <[email protected]> S: Maintained F: qga/ F: docs/interop/qemu-ga.rst +F: docs/interop/qemu-ga-ref.rst F: scripts/qemu-guest-agent/ F: tests/test-qga.c -F: docs/interop/qemu-ga-ref.texi T: git https://github.com/mdroth/qemu.git qga QOM
docs/index.html.in +0 -1
@@ -9,7 +9,6 @@ <ul> <li><a href="qemu-doc.html">User Documentation</a></li> <li><a href="qemu-qmp-ref.html">QMP Reference Manual</a></li> - <li><a href="qemu-ga-ref.html">Guest Agent Protocol Reference</a></li> <li><a href="interop/index.html">System Emulation Management and Interoperability Guide</a></li> <li><a href="specs/index.html">System Emulation Guest Hardware Specifications</a></li> <li><a href="system/index.html">System Emulation User's Guide</a></li>
docs/interop/conf.py +2 -0
@@ -19,6 +19,8 @@ html_theme_options['description'] = u'System Emulation Management and Interopera man_pages = [ ('qemu-ga', 'qemu-ga', u'QEMU Guest Agent', ['Michael Roth <[email protected]>'], 8), + ('qemu-ga-ref', 'qemu-ga-ref', u'QEMU Guest Agent Protocol Reference', + [], 7), ('qemu-img', 'qemu-img', u'QEMU disk image utility', ['Fabrice Bellard'], 1), ('qemu-nbd', 'qemu-nbd', u'QEMU Disk Network Block Device Server',
docs/interop/index.rst +1 -0
@@ -18,6 +18,7 @@ Contents: live-block-operations pr-helper qemu-ga + qemu-ga-ref qemu-img qemu-nbd qemu-trace-stap
docs/interop/qemu-ga-ref.rst new file +4 -0
@@ -0,0 +1,4 @@ +QEMU Guest Agent Protocol Reference +=================================== + +.. qapi-doc:: qga/qapi-schema.json
docs/interop/qemu-ga-ref.texi deleted +0 -80
80 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 25/29 docs/interop: Convert qemu-qmp-ref to rST
In reply to Peter MaydellConvert qemu-qmp-ref to rST format. This includes dropping the plain-text, pdf and info format outputs for this document; as with all our other Sphinx-based documentation, we provide HTML and manpage only.
The qemu-qmp-ref.rst is somewhat more stripped down than the .texi was, because we do not (currently) attempt to generate indexes for the commands, events and data types being documented.
Again, we drop the direct link from index.html.in now that the QMP ref is part of the interop manual.
--- Makefile | 37 +++++----------- docs/index.html.in | 1 - docs/interop/conf.py | 2 + docs/interop/index.rst | 1 + docs/interop/qemu-qmp-ref.rst | 4 ++ docs/interop/qemu-qmp-ref.texi | 80 ---------------------------------- 6 files changed, 17 insertions(+), 108 deletions(-) create mode 100644 docs/interop/qemu-qmp-ref.rst delete mode 100644 docs/interop/qemu-qmp-ref.texi
Makefile +10 -27
@@ -126,7 +126,6 @@ GENERATED_QAPI_FILES += qapi/qapi-events.h qapi/qapi-events.c GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.h) GENERATED_QAPI_FILES += $(QAPI_MODULES:%=qapi/qapi-events-%.c) GENERATED_QAPI_FILES += qapi/qapi-introspect.c qapi/qapi-introspect.h -GENERATED_QAPI_FILES += qapi/qapi-doc.texi generated-files-y += $(GENERATED_QAPI_FILES)
@@ -349,8 +348,8 @@ DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-img.1 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-nbd.8 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8 DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 -DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga-ref.7 +DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-qmp-ref.7 DOCS+=docs/qemu-cpu-models.7 DOCS+=$(MANUAL_BUILDDIR)/index.html ifdef CONFIG_VIRTFS
@@ -612,8 +611,7 @@ $(SRC_PATH)/scripts/qapi-gen.py 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-init-commands.h qga/qapi-generated/qga-qapi-init-commands.c \ -qga/qapi-generated/qga-qapi-doc.texi: \ +qga/qapi-generated/qga-qapi-init-commands.h qga/qapi-generated/qga-qapi-init-commands.c: \ qga/qapi-generated/qapi-gen-timestamp ; qga/qapi-generated/qapi-gen-timestamp: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \
@@ -759,11 +757,6 @@ distclean: clean rm -f config.log rm -f linux-headers/asm rm -f docs/version.texi - rm -f docs/interop/qemu-qmp-qapi.texi - rm -f docs/interop/qemu-qmp-ref.7 - rm -f docs/interop/qemu-qmp-ref.txt - rm -f docs/interop/qemu-qmp-ref.pdf - rm -f docs/interop/qemu-qmp-ref.html rm -f docs/qemu-cpu-models.7 rm -rf .doctrees $(call clean-manual,devel)
@@ -817,7 +810,7 @@ endif # and also any sphinx-built manpages. define install-manual = for d in $$(cd $(MANUAL_BUILDDIR) && find $1 -type d); do $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)/$$d"; done -for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' '(' -name '*.[0-9]' -o -name 'qemu-*-qapi.*' -o -name 'qemu-qmp-ref.*' ')' ); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done +for f in $$(cd $(MANUAL_BUILDDIR) && find $1 -type f -a '!' -name '*.[0-9]'); do $(INSTALL_DATA) "$(MANUAL_BUILDDIR)/$$f" "$(DESTDIR)$(qemu_docdir)/$$f"; done endef # Note that we deliberately do not install the "devel" manual: it is
@@ -833,13 +826,11 @@ install-doc: $(DOCS) install-sphinxdocs $(INSTALL_DATA) $(MANUAL_BUILDDIR)/index.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.txt "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.html "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)" ifdef CONFIG_POSIX $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" - $(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" + $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" $(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7" $(INSTALL_DATA) docs/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7" ifeq ($(CONFIG_TOOLS),y)
@@ -1039,7 +1030,7 @@ endef $(MANUAL_BUILDDIR)/devel/index.html: $(call manual-deps,devel) $(call build-manual,devel,html) -$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) +$(MANUAL_BUILDDIR)/interop/index.html: $(call manual-deps,interop) $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/qga/qapi-schema.json $(qapi-modules) $(qapi-py) $(call build-manual,interop,html) $(MANUAL_BUILDDIR)/specs/index.html: $(call manual-deps,specs)
@@ -1052,7 +1043,7 @@ $(call define-manpage-rule,interop,\ qemu-ga.8 qemu-ga-ref.7 \ qemu-img.1 qemu-nbd.8 qemu-trace-stap.1 virtfs-proxy-helper.1,\ $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/qga/qapi-schema.json \ - $(qapi-py)) + $(qapi-modules) $(qapi-py)) $(call define-manpage-rule,system,qemu-block-drivers.7)
@@ -1070,17 +1061,14 @@ qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") -docs/interop/qemu-qmp-qapi.texi: qapi/qapi-doc.texi - @cp -p $< $@ - qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi qemu.1: qemu-option-trace.texi docs/qemu-cpu-models.7: docs/qemu-cpu-models.texi -html: qemu-doc.html docs/interop/qemu-qmp-ref.html sphinxdocs -info: qemu-doc.info docs/interop/qemu-qmp-ref.info -pdf: qemu-doc.pdf docs/interop/qemu-qmp-ref.pdf -txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt +html: qemu-doc.html sphinxdocs +info: qemu-doc.info +pdf: qemu-doc.pdf +txt: qemu-doc.txt qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-options.texi \
@@ -1089,11 +1077,6 @@ qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-monitor-info.texi \ docs/qemu-cpu-models.texi docs/security.texi -docs/interop/qemu-qmp-ref.dvi docs/interop/qemu-qmp-ref.html \ - docs/interop/qemu-qmp-ref.info docs/interop/qemu-qmp-ref.pdf \ - docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7: \ - docs/interop/qemu-qmp-ref.texi docs/interop/qemu-qmp-qapi.texi - $(filter %.1 %.7 %.8,$(DOCS)): scripts/texi2pod.pl # Reports/Analysis
docs/index.html.in +0 -1
@@ -8,7 +8,6 @@ <h1>QEMU @@VERSION@@ Documentation</h1> <ul> <li><a href="qemu-doc.html">User Documentation</a></li> - <li><a href="qemu-qmp-ref.html">QMP Reference Manual</a></li> <li><a href="interop/index.html">System Emulation Management and Interoperability Guide</a></li> <li><a href="specs/index.html">System Emulation Guest Hardware Specifications</a></li> <li><a href="system/index.html">System Emulation User's Guide</a></li>
docs/interop/conf.py +2 -0
@@ -25,6 +25,8 @@ man_pages = [ ['Fabrice Bellard'], 1), ('qemu-nbd', 'qemu-nbd', u'QEMU Disk Network Block Device Server', ['Anthony Liguori <[email protected]>'], 8), + ('qemu-qmp-ref', 'qemu-qmp-ref', u'QEMU QMP Reference Manual', + [], 7), ('qemu-trace-stap', 'qemu-trace-stap', u'QEMU SystemTap trace tool', [], 1), ('virtfs-proxy-helper', 'virtfs-proxy-helper',
docs/interop/index.rst +1 -0
@@ -21,6 +21,7 @@ Contents: qemu-ga-ref qemu-img qemu-nbd + qemu-qmp-ref qemu-trace-stap vhost-user vhost-user-gpu
docs/interop/qemu-qmp-ref.rst new file +4 -0
@@ -0,0 +1,4 @@ +QEMU QMP Reference Manual +========================= + +.. qapi-doc:: qapi/qapi-schema.json
docs/interop/qemu-qmp-ref.texi deleted +0 -80
80 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 26/29 qapi: Use rST markup for literal blocks
In reply to Peter MaydellThere are exactly two places in our json doc comments where we use the markup accepted by the texi doc generator where a '|' in the first line of a doc comment means the line should be emitted as a literal block (fixed-width font, whitespace preserved).
Since we use this syntax so rarely, instead of making the rST generator support it, instead just convert the two uses to rST-format literal blocks, which are indented and introduced with '::'.
(The rST generator doesn't complain about the old style syntax, it just emits it with the '|' and with the whitespace not preserved, which looks odd, but means we can safely leave this change until after we've stopped generating texinfo.)
--- qapi/block-core.json | 16 +++++++++------- qapi/qapi-schema.json | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-)
qapi/block-core.json +9 -7
@@ -550,13 +550,15 @@ # For the example above, @bins may be something like [3, 1, 5, 2], # and corresponding histogram looks like: # -# | 5| * -# | 4| * -# | 3| * * -# | 2| * * * -# | 1| * * * * -# | +------------------ -# | 10 50 100 +# :: +# +# 5| * +# 4| * +# 3| * * +# 2| * * * +# 1| * * * * +# +------------------ +# 10 50 100 # # Since: 4.0 ##
qapi/qapi-schema.json +4 -2
@@ -22,8 +22,10 @@ # # Example: # -# | -> data issued by the Client -# | <- Server data response +# :: +# +# -> data issued by the Client +# <- Server data response # # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for # detailed information on the Server command and response formats.
Signature · 1 line
2.20.1
PATCH 27/29 qga/qapi-schema.json: Add some headings
In reply to Peter MaydellAdd some section headings to the QGA json; this is purely so that we have some H1 headings, as otherwise each command ends up being visible in the interop/ manual's table of contents. In an ideal world there might be a proper 'Introduction' section the way there is in qapi/qapi-schema.json.
--- qga/qapi-schema.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
qga/qapi-schema.json +8 -4
@@ -1,14 +1,18 @@ # *-*- Mode: Python -*-* ## -# -# General note concerning the use of guest agent interfaces: -# +# = General note concerning the use of guest agent interfaces +## + +## # "unsupported" is a higher-level error than the errors that individual # commands might document. The caller should always be prepared to receive # QERR_UNSUPPORTED, even if the given command doesn't specify it, or doesn't # document any failure mode at all. -# +## + +## +# = QEMU guest agent protocol commands and structs ## { 'pragma': { 'doc-required': true } }
Signature · 1 line
2.20.1
PATCH 28/29 scripts/qapi: Remove texinfo generation support
In reply to Peter MaydellWe no longer use the generated texinfo format documentation, so delete the code that generates it, and the test case for the generation.
--- Makefile | 1 - tests/Makefile.include | 15 +- scripts/qapi-gen.py | 2 - scripts/qapi/doc.py | 303 ----------------------------------------- scripts/qapi/gen.py | 7 - 5 files changed, 1 insertion(+), 327 deletions(-) delete mode 100644 scripts/qapi/doc.py
Makefile +0 -1
@@ -595,7 +595,6 @@ qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS) qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \ $(SRC_PATH)/scripts/qapi/commands.py \ $(SRC_PATH)/scripts/qapi/common.py \ -$(SRC_PATH)/scripts/qapi/doc.py \ $(SRC_PATH)/scripts/qapi/error.py \ $(SRC_PATH)/scripts/qapi/events.py \ $(SRC_PATH)/scripts/qapi/expr.py \
tests/Makefile.include +1 -14
@@ -32,7 +32,6 @@ export SRC_PATH qapi-py = $(SRC_PATH)/scripts/qapi/__init__.py \ $(SRC_PATH)/scripts/qapi/commands.py \ $(SRC_PATH)/scripts/qapi/common.py \ -$(SRC_PATH)/scripts/qapi/doc.py \ $(SRC_PATH)/scripts/qapi/error.py \ $(SRC_PATH)/scripts/qapi/events.py \ $(SRC_PATH)/scripts/qapi/expr.py \
@@ -486,16 +485,8 @@ tests/test-qapi-gen-timestamp: \ $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ -o tests -p "test-" $<, \ "GEN","$(@:%-timestamp=%)") - @rm -f tests/test-qapi-doc.texi @>$@ -tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(qapi-py) - $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ - -o tests/qapi-schema -p "doc-good-" $<, \ - "GEN","$@") - @mv tests/qapi-schema/doc-good-qapi-doc.texi $@ - @rm -f tests/qapi-schema/doc-good-qapi-*.[ch] tests/qapi-schema/doc-good-qmp-*.[ch] - tests/qtest/dbus-vmstate1.h tests/qtest/dbus-vmstate1.c: tests/qtest/dbus-vmstate1-gen-timestamp ; tests/qtest/dbus-vmstate1-gen-timestamp: $(SRC_PATH)/tests/qtest/dbus-vmstate1.xml $(call quiet-command,$(GDBUS_CODEGEN) $< \
@@ -847,10 +838,6 @@ check-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema- PYTHONIOENCODING=utf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py $^, \ TEST, check-qapi-schema) -.PHONY: check-tests/qapi-schema/doc-good.texi -check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi - @diff -u $(SRC_PATH)/tests/qapi-schema/doc-good.texi $< - .PHONY: check-decodetree check-decodetree: $(call quiet-command, \
@@ -898,7 +885,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) # Consolidated targets .PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean -check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi +check-qapi-schema: check-tests/qapi-schema/frontend check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) ifeq ($(CONFIG_TOOLS),y) check-block: $(patsubst %,check-%, $(check-block-y))
scripts/qapi-gen.py +0 -2
@@ -11,7 +11,6 @@ import re import sys from qapi.commands import gen_commands -from qapi.doc import gen_doc from qapi.events import gen_events from qapi.introspect import gen_introspect from qapi.schema import QAPIError, QAPISchema
@@ -52,7 +51,6 @@ def main(argv): gen_commands(schema, args.output_dir, args.prefix) gen_events(schema, args.output_dir, args.prefix) gen_introspect(schema, args.output_dir, args.prefix, args.unmask) - gen_doc(schema, args.output_dir, args.prefix) if __name__ == '__main__':
scripts/qapi/doc.py deleted +0 -303
303 lines not on this page · raw message
scripts/qapi/gen.py +0 -7
@@ -177,13 +177,6 @@ def ifcontext(ifcond, *args): arg.end_if() -class QAPIGenDoc(QAPIGen): - - def _top(self): - return (QAPIGen._top(self) - + '@c AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n') - - class QAPISchemaMonolithicCVisitor(QAPISchemaVisitor): def __init__(self, prefix, what, blurb, pydoc):
Signature · 1 line
2.20.1
Re: [PATCH 28/29] scripts/qapi: Remove texinfo generation support
Quoted 6 lines · Peter Maydell
We no longer use the generated texinfo format documentation, so delete the code that generates it, and the test case for the generation.
Signed-off-by Peter Maydell <[email protected]>
Quoted 8 lines
--- Makefile | 1 - tests/Makefile.include | 15 +- scripts/qapi-gen.py | 2 - scripts/qapi/doc.py | 303 ----------------------------------------- scripts/qapi/gen.py | 7 - 5 files changed, 1 insertion(+), 327 deletions(-) delete mode 100644 scripts/qapi/doc.py
Looks like I forgot to delete the no-longer-used golden reference tests/qapi-schema/doc-good.texi -- I'll just fold that 'git rm' into this patch, in the unlikely event that I don't need to respin it for some other reason.
thanks
-- PMM
PATCH 29/29 docs/devel/qapi-code-gen.txt: Update to new rST backend conventions
In reply to Peter MaydellUpdate the documentation of QAPI document comment syntax to match the new rST backend requirements. The principal changes are:
* whitespace is now significant, and multiline definitions must have their second and subsequent lines indented to match the first line
* general rST format markup is permitted, not just the small set of markup the old texinfo generator handled. For most things (notably bulleted and itemized lists) the old format is the same as rST was.
* Specific things that might trip people up:
- instead of *bold* and _italic_ rST has **bold** and *italic*
- lists need a preceding and following blank line
- a lone literal '*' will need to be backslash-escaped to avoid a rST syntax error
* the old leading '|' for example (literal text) blocks is replaced by the standard rST '::' literal block.
* headings and subheadings must now be in a freeform documentation comment of their own
* we support arbitrary levels of sub- and sub-sub-heading, not just a main and sub-heading like the old texinfo generator
--- docs/devel/qapi-code-gen.txt | 90 ++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 29 deletions(-)
docs/devel/qapi-code-gen.txt +61 -29
@@ -795,21 +795,39 @@ See below for more on definition documentation. Free-form documentation may be used to provide additional text and structuring content. +==== Headings and subheadings ==== + +A free-form documentation comment containing a single line +which starts with some '=' symbols and then a space defines +a section heading: + + ## + # = This is a top level heading + ## + + ## + # This is a free-form comment which will go under the + # top level heading. + ## + + ## + # == This is a second level heading + ## + +Section headings must always be correctly nested, so you can only +define a third-level heading inside a second-level heading, and so +on. The documentation generator will catch nesting mistakes and report +a syntax error. ==== Documentation markup ==== -Comment text starting with '=' is a section title: +Documentation comments can use most rST markup. In particular, +a '::' literal block can be used for examples: - # = Section title - -Double the '=' for a subsection title: - - # == Subsection title - -'|' denotes examples: - - # | Text of the example, may span - # | multiple lines + # :: + # + # Text of the example, may span + # multiple lines '*' starts an itemized list:
@@ -825,37 +843,35 @@ A decimal number followed by '.' starts a numbered list: # multiple lines # 2. Second item -The actual number doesn't matter. You could even use '*' instead of -'2.' for the second item. +The actual number doesn't matter. -Lists can't be nested. Blank lines are currently not supported within -lists. +Lists of either kind must be preceded and followed by a blank line. +If a list item's text spans multiple lines, then the second and +subsequent lines must be correctly indented to line up with the +first character of the first line. -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. +The usual '**strong**', '*emphasised*' and '``literal``' markup should +be used. If you need a single literal '*' you will need to backslash-escape it. +As an extension beyond the usual rST syntax, you can also +use '@foo' to reference a name in the schema; this is rendered +the same way as '``foo``'. Example: ## -# = Section -# == Subsection -# -# Some text foo with *strong* and _emphasis_ +# Some text foo with **bol** and *emphasis* # 1. with a list # 2. like that # # And some code: -# | $ echo foo -# | -> do this -# | <- get that # +# :: +# +# $ echo foo +# -> do this +# <- get that ## - ==== Definition documentation ==== Definition documentation, if present, must immediately precede the
@@ -870,6 +886,12 @@ commands and events), member (for structs and unions), branch (for alternates), or value (for enums), and finally optional tagged sections. +Descriptions of arguments can span multiple lines; if they +do then the second and subsequent lines must be indented +to line up with the first character of the first line of the +description. The parser will report a syntax error if there +is insufficient indentation. + FIXME: the parser accepts these things in almost any order. FIXME: union branches should be described, too.
@@ -883,6 +905,16 @@ The section ends with the start of a new section. A 'Since: x.y.z' tagged section lists the release that introduced the definition. +The text of a section can start on a new line, in +which case it must not be indented at all. It can also start +on the same line as the 'Note:', 'Returns:', etc tag. In this +case if it spans multiple lines then second and subsequent +lines must be indented to match the first. + +An 'Example' or 'Examples' section is automatically rendered +entirely as literal fixed-width text. In other sections, +the text is formatted, and rST markup can be used. + For example: ##
Signature · 1 line
2.20.1
Quoted 2 lines · Peter Maydell
This series switches all our QAPI doc comments over from texinfo format to rST.
Oops, this fails 'make check' because I forgot to run it (not thinking of docs changes as being stuff that affects test) and there are a couple of golden-master files that need updating. I have some minor changes that I'll put in v2 which correct that:
* a new patch "tests/qapi/doc-good.json: Clean up markup" which removes some oddities of the old markup that we don't want to support, tightening up the tested doc comments:
* in a single list the bullet types must all match
* lists must have leading and following blank lines
* indentation is important
* the '|' example syntax is going to go away entirely,
so stop testing it
* patches "scripts/qapi: Move doc-comment whitespace stripping to doc.py" and "scripts/qapi/parser.py: improve doc comment indent handling" both make minor whitespace changes that require updates to the tests/qapi-schema/doc-good.out reference
* "scripts/qapi: Remove texinfo generation support" now removes the no-longer-used tests/qapi-schema/doc-good.texi
I won't send v2 until this has had some review, though. If you want a git branch with the pending-for-v2 fixups it's at:
https://git.linaro.org/people/peter.maydell/qemu-arm.git sphinx-conversions
thanks
-- PMM
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===
GEN docs/index.html
CC crypto/aes.o
No filename or title
make: *** [/tmp/qemu-test/src/rules.mak:392: docs/interop/qemu-qmp-ref.7] Error 255
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
File "./tests/docker/docker.py", line 664, in <module>
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=62059c3553b64eb384aee0a720c4473b', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-_3tt9kgf/src/docker-src.2020-02-06-14.51.13.6510:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=62059c3553b64eb384aee0a720c4473b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-_3tt9kgf/src'
make: *** [docker-run-test-mingw@fedora] Error 2
real 2m2.836s
user 0m8.762s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===
CC tests/test-qapi-commands.o CC tests/test-string-input-visitor.o CC tests/test-string-output-visitor.o
doc-good FAIL
tmp/qemu-test/src/tests/qapi-schema/doc-good.out deleted +0 -1
@@ -1,199 +0,0 @@ ---
+++
@@ -0,0 +1 @@
+doc-good.json:104:1: unexpected de-indent
make: *** [check-tests/qapi-schema/frontend] Error 1
make: *** Waiting for unfinished jobs....
CC tests/test-qmp-event.o
Traceback (most recent call last):
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=ac8e8dbf593c42e385721554759cb252', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-y9h_kw4r/src/docker-src.2020-02-06-14.53.51.11537:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=ac8e8dbf593c42e385721554759cb252
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-y9h_kw4r/src'
make: *** [docker-run-test-quick@centos7] Error 2
real 2m17.651s
user 0m7.653s
The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
Quoted 14 lines · Peter Maydell
This series switches all our QAPI doc comments over from texinfo format to rST.
The basic approach is somewhat similar to how we deal with kerneldoc and hxtool: we have a custom Sphinx extension which is passed a filename which is the json file it should run the QAPI parser over and generate documentation for. Unlike 'kerneldoc' but somewhat like hxtool, I have chosed to generate documentation by generating a tree of docutils nodes, rather than by generating rST source that is then fed to the rST parser to generate docutils nodes. Individual lumps of doc comment go to the rST parser, but the structured parts we render directly. This makes it easier to get the structure and heading level nesting correct.
Quoted 11 lines
Rather than trying to exactly handle all the existing comments I have opted (as Markus suggested) to tweak them where this seemed more sensible than contorting the rST generator to deal with weirdnesses. The principal changes are:
* whitespace is now significant, and multiline definitions must have their second and subsequent lines indented to match the first line
* general rST format markup is permitted, not just the small set of markup the old texinfo generator handled. For most things (notably bulleted and itemized lists) the old format is the same as rST was.
* Specific things that might trip people up:
- instead of *bold* and _italic_ rST has **bold** and *italic*
Actually, qapi-code-gen.txt documents and doc.py implements *strong* and _emphasis_. Texinfo commonly renders them as bold and italic when the output format supports that. rST has **strong** and *emphasis*.
Your series adjusts emphasis markup for rST [PATCH 18]. Since it doesn't touch strong markup, strong silently becomes emphasis. I guess that's okay, perhaps even an improvement, but double-checking the actual uses of this markup wouldn't hurt.
Quoted 7 lines
- lists need a preceding and following blank line
- a lone literal '*' will need to be backslash-escaped to avoid a rST syntax error
* the old leading '|' for example (literal text) blocks is replaced by the standard rST '::' literal block.
* headings and subheadings must now be in a freeform documentation comment of their own
Can we simply use rST instead? See my review of PATCH 18.
Quoted 3 lines
* we support arbitrary levels of sub- and sub-sub-heading, not just a main and sub-heading like the old texinfo generator
* as a special case, @foo is retained and is equivalent to ``foo``
Apart from these remarks, your changes look sensible to me right now. I hope they'll still look that way when I'm done reviewing :)
[...]
Quoted 29 lines · Markus Armbruster
Quoted 14 lines · Peter Maydell
This series switches all our QAPI doc comments over from texinfo format to rST.
The basic approach is somewhat similar to how we deal with kerneldoc and hxtool: we have a custom Sphinx extension which is passed a filename which is the json file it should run the QAPI parser over and generate documentation for. Unlike 'kerneldoc' but somewhat like hxtool, I have chosed to generate documentation by generating a tree of docutils nodes, rather than by generating rST source that is then fed to the rST parser to generate docutils nodes. Individual lumps of doc comment go to the rST parser, but the structured parts we render directly. This makes it easier to get the structure and heading level nesting correct.
Quoted 11 lines
Rather than trying to exactly handle all the existing comments I have opted (as Markus suggested) to tweak them where this seemed more sensible than contorting the rST generator to deal with weirdnesses. The principal changes are:
* whitespace is now significant, and multiline definitions must have their second and subsequent lines indented to match the first line
* general rST format markup is permitted, not just the small set of markup the old texinfo generator handled. For most things (notably bulleted and itemized lists) the old format is the same as rST was.
* Specific things that might trip people up:
- instead of *bold* and _italic_ rST has **bold** and *italic*
Quoted 8 lines
Actually, qapi-code-gen.txt documents and
doc.pyimplements *strong* and _emphasis_. Texinfo commonly renders them as bold and italic when the output format supports that. rST has **strong** and *emphasis*.Your series adjusts emphasis markup for rST [PATCH 18]. Since it doesn't touch strong markup, strong silently becomes emphasis. I guess that's okay, perhaps even an improvement, but double-checking the actual uses of this markup wouldn't hurt.
Yeah, that would be a good plan.
git grep '\*[^*]*\*' qapi/*.json
(and eyeball-filtering out the false hits) shows just one use:
qapi/introspect.json:# Note: the QAPI schema is also used to help define *internal*
I can put a patch on the end which converts that to **internal** once the rST generator is in use.
Quoted 9 lines
Quoted 7 lines
- lists need a preceding and following blank line
- a lone literal '*' will need to be backslash-escaped to avoid a rST syntax error
* the old leading '|' for example (literal text) blocks is replaced by the standard rST '::' literal block.
* headings and subheadings must now be in a freeform documentation comment of their ownCan we simply use rST instead? See my review of PATCH 18.
No, we can't (see my reply to that review). In theory you could have the heading syntax be a rST heading, but that is not feasible to recognise in the Python script[*] and it gives the impression that it is just an inline rST heading, not something that's more complicated and structured.
[*] You'd need to manually re-implement the weird thing rST does where practically any kind of underlining is valid and it figures out which one means which depth by looking at the usage through the whole document. You'd have to do bizarre stuff like running through the entire set of doc comments once doing no output but just looking at heading underline characters to guess which one is which depth, and then once you'd figured that out you could do it all over again actually generating the doc.
thanks
-- PMM
Quoted 43 lines · Peter Maydell
Quoted 29 lines · Markus Armbruster
Quoted 14 lines · Peter Maydell
This series switches all our QAPI doc comments over from texinfo format to rST.
The basic approach is somewhat similar to how we deal with kerneldoc and hxtool: we have a custom Sphinx extension which is passed a filename which is the json file it should run the QAPI parser over and generate documentation for. Unlike 'kerneldoc' but somewhat like hxtool, I have chosed to generate documentation by generating a tree of docutils nodes, rather than by generating rST source that is then fed to the rST parser to generate docutils nodes. Individual lumps of doc comment go to the rST parser, but the structured parts we render directly. This makes it easier to get the structure and heading level nesting correct.
Quoted 11 lines
Rather than trying to exactly handle all the existing comments I have opted (as Markus suggested) to tweak them where this seemed more sensible than contorting the rST generator to deal with weirdnesses. The principal changes are:
* whitespace is now significant, and multiline definitions must have their second and subsequent lines indented to match the first line
* general rST format markup is permitted, not just the small set of markup the old texinfo generator handled. For most things (notably bulleted and itemized lists) the old format is the same as rST was.
* Specific things that might trip people up:
- instead of *bold* and _italic_ rST has **bold** and *italic*Quoted 8 lines
Actually, qapi-code-gen.txt documents and
doc.pyimplements *strong* and _emphasis_. Texinfo commonly renders them as bold and italic when the output format supports that. rST has **strong** and *emphasis*.Your series adjusts emphasis markup for rST [PATCH 18]. Since it doesn't touch strong markup, strong silently becomes emphasis. I guess that's okay, perhaps even an improvement, but double-checking the actual uses of this markup wouldn't hurt.
Yeah, that would be a good plan.
git grep '\*[^*]*\*' qapi/*.json
(and eyeball-filtering out the false hits) shows just one use:
Quoted 5 lines
qapi/introspect.json:# Note: the QAPI schema is also used to help define *internal*
I can put a patch on the end which converts that to **internal** once the rST generator is in use.
I wrote that one, and I think changing it from strong to emphasis is an improvement. Let's point to it in the commit message, and call it a day.
Quoted 16 lines
Quoted 9 lines
Quoted 7 lines
- lists need a preceding and following blank line
- a lone literal '*' will need to be backslash-escaped to avoid a rST syntax error
* the old leading '|' for example (literal text) blocks is replaced by the standard rST '::' literal block.
* headings and subheadings must now be in a freeform documentation comment of their ownCan we simply use rST instead? See my review of PATCH 18.
No, we can't (see my reply to that review). In theory you could have the heading syntax be a rST heading, but that is not feasible to recognise in the Python script[*] and it gives the impression that it is just an inline rST heading, not something that's more complicated and structured.
Quoted 8 lines
[*] You'd need to manually re-implement the weird thing rST does where practically any kind of underlining is valid and it figures out which one means which depth by looking at the usage through the whole document. You'd have to do bizarre stuff like running through the entire set of doc comments once doing no output but just looking at heading underline characters to guess which one is which depth, and then once you'd figured that out you could do it all over again actually generating the doc.
I understand the difficulty of parsing rST (Paolo called it "the Perl of markup languages" for a reason). What I don't yet understand is (1) why we need to recognize the document structure of doc comments, and (2) why we can do that by recognizing '=' markup, but ignore the native rST document structure markup.
Quoted 5 lines · Markus Armbruster
I understand the difficulty of parsing rST (Paolo called it "the Perl of markup languages" for a reason). What I don't yet understand is (1) why we need to recognize the document structure of doc comments, and (2) why we can do that by recognizing '=' markup, but ignore the native rST document structure markup.
I think we're completely at cross purposes here, so there's something I've not managed to communicate clearly.
We don't need to recognize the document structure of doc comments, indeed my implementation does not -- it just throws a doc comment at the rST parser to handle.
We *do* need to recognize the structure *of the document* (ie that it does have a thing with a heading "Block devices" that contains another thing with a heading "Background jobs" that in turn contains documentation for JobType, JobStatus....) so that when we're building up our tree of docutils node objects we know when we need to create a new 'section' node and give it a title 'Block devices' and which of the various section nodes in the tree should have all the nodes that make up the documentation of 'JobType' added to it.
In order to achieve this separation (don't care about document structure inside lumps of rST, but do want to know what the overall section/subsection structure of the document is), this patchset pulls the identification of the document structure (heading/subheadings) completely out of being something you might find in the middle of a doc comment, and makes them their own
special kind of markup:
##
# = This is a heading
##
(In my head I find I'm thinking of this as "not actually a doc comment", which is probably where some of my lack of clarity is coming from, since syntactically speaking and from the point of view of qapi/parser.py that is a sort of doc comment.)
I suppose that there's an argument that the identification of headings and subheadings should really be done in qapi/parser.py, so that instead of
vis = QAPISchemaGenRSTVisitor(self) vis.visit_begin(schema)
for doc in schema.docs:
if doc.symbol:
vis.symbol(doc, schema.lookup_entity(doc.symbol))
else:
vis.freeform(doc)
you would have something more like
vis = QAPISchemaGenRSTVisitor(self) vis.visit_begin(schema)
for doc in schema.docs:
if doc.symbol:
vis.symbol(doc, schema.lookup_entity(doc.symbol))
else if doc.is_section_header:
vis.start_new_section(doc)
else:
vis.freeform(doc)
(with the identification of headers and pulling out of what level of nesting this header is and what its text is done in parser.py)
thanks
-- PMM
Quoted 5 lines · Peter Maydell
Quoted 3 lines
This series switches all our QAPI doc > > > comments over from texinfo format to rST.
Regardeless of the outcome of the discussions over this series, I just want to say that I support it as a potential user of the document (there is no "Supported-by:" mark or similar, so this is all I can do). Also, as a general participant in QEMU community, I seems to me this is a significant step in shaping up QEMU documentation.
Best regards,
Aleksandar