62 changes: 59 additions & 3 deletions docs/devel/qapi-code-gen.rst
Expand Up @@ -924,14 +924,17 @@ first character of the first line.
The usual ****strong****, *\*emphasized\** 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````.
backslash-escape it.
Use ``@foo`` to reference a name in the schema. This is an rST
extension. It is rendered the same way as ````foo````, but carries
additional meaning.
Example::
##
# Some text foo with **bold** and *emphasis*
#
# 1. with a list
# 2. like that
#
Expand Down Expand Up @@ -1057,6 +1060,59 @@ For example::
'returns': ['BlockStats'] }
Markup pitfalls
~~~~~~~~~~~~~~~
A blank line is required between list items and paragraphs. Without
it, the list may not be recognized, resulting in garbled output. Good
example::
# An event's state is modified if:
#
# - its name matches the @name pattern, and
# - if @vcpu is given, the event has the "vcpu" property.
Without the blank line this would be a single paragraph.
Indentation matters. Bad example::
# @none: None (no memory side cache in this proximity domain,
# or cache associativity unknown)
The description is parsed as a definition list with term "None (no
memory side cache in this proximity domain," and definition "or cache
associativity unknown)".
Section tags are case-sensitive and end with a colon. Good example::
# Since: 7.1
Bad examples (all ordinary paragraphs)::
# since: 7.1
# Since 7.1
# Since : 7.1
Likewise, member descriptions require a colon. Good example::
# @interface-id: Interface ID
Bad examples (all ordinary paragraphs)::
# @interface-id Interface ID
# @interface-id : Interface ID
Undocumented members are not flagged, yet. Instead, the generated
documentation describes them as "Not documented". Think twice before
adding more undocumented members.
When you change documentation comments, please check the generated
documentation comes out as intended!
Client JSON Protocol introspection
==================================
Expand Down
6 changes: 3 additions & 3 deletions docs/interop/firmware.json
Expand Up @@ -258,7 +258,7 @@
#
# @mode: Describes how the firmware build handles code versus variable
# storage. If not present, it must be treated as if it was
# configured with value ``split``. Since: 7.0.0
# configured with value @split. Since: 7.0.0
#
# @executable: Identifies the firmware executable. The @mode
# indicates whether there will be an associated
Expand All @@ -267,13 +267,13 @@
# -drive if=none,id=pflash0,readonly=on,file=@executable.@filename,format=@executable.@format
# -machine pflash0=pflash0
# or equivalent -blockdev instead of -drive. When
# @mode is ``combined`` the executable must be
# @mode is @combined the executable must be
# cloned before use and configured with readonly=off.
# With QEMU versions older than 4.0, you have to use
# -drive if=pflash,unit=0,readonly=on,file=@executable.@filename,format=@executable.@format
#
# @nvram-template: Identifies the NVRAM template compatible with
# @executable, when @mode is set to ``split``,
# @executable, when @mode is set to @split,
# otherwise it should not be present.
# Management software instantiates an
# individual copy -- a specific NVRAM file -- from
Expand Down
82 changes: 40 additions & 42 deletions qapi/block-core.json
Expand Up @@ -488,41 +488,41 @@
#
# @image: the info of image used (since: 1.6)
#
# @bps_max: total throughput limit during bursts,
# in bytes (Since 1.7)
# @bps_max: total throughput limit during bursts, in bytes
# (Since 1.7)
#
# @bps_rd_max: read throughput limit during bursts,
# in bytes (Since 1.7)
# @bps_rd_max: read throughput limit during bursts, in bytes
# (Since 1.7)
#
# @bps_wr_max: write throughput limit during bursts,
# in bytes (Since 1.7)
# @bps_wr_max: write throughput limit during bursts, in bytes
# (Since 1.7)
#
# @iops_max: total I/O operations per second during bursts,
# in bytes (Since 1.7)
# @iops_max: total I/O operations per second during bursts, in bytes
# (Since 1.7)
#
# @iops_rd_max: read I/O operations per second during bursts,
# in bytes (Since 1.7)
# @iops_rd_max: read I/O operations per second during bursts, in bytes
# (Since 1.7)
#
# @iops_wr_max: write I/O operations per second during bursts,
# in bytes (Since 1.7)
# @iops_wr_max: write I/O operations per second during bursts, in
# bytes (Since 1.7)
#
# @bps_max_length: maximum length of the @bps_max burst
# period, in seconds. (Since 2.6)
# @bps_max_length: maximum length of the @bps_max burst period, in
# seconds. (Since 2.6)
#
# @bps_rd_max_length: maximum length of the @bps_rd_max
# burst period, in seconds. (Since 2.6)
# @bps_rd_max_length: maximum length of the @bps_rd_max burst period,
# in seconds. (Since 2.6)
#
# @bps_wr_max_length: maximum length of the @bps_wr_max
# burst period, in seconds. (Since 2.6)
# @bps_wr_max_length: maximum length of the @bps_wr_max burst period,
# in seconds. (Since 2.6)
#
# @iops_max_length: maximum length of the @iops burst
# period, in seconds. (Since 2.6)
# @iops_max_length: maximum length of the @iops burst period, in
# seconds. (Since 2.6)
#
# @iops_rd_max_length: maximum length of the @iops_rd_max
# burst period, in seconds. (Since 2.6)
# @iops_rd_max_length: maximum length of the @iops_rd_max burst
# period, in seconds. (Since 2.6)
#
# @iops_wr_max_length: maximum length of the @iops_wr_max
# burst period, in seconds. (Since 2.6)
# @iops_wr_max_length: maximum length of the @iops_wr_max burst
# period, in seconds. (Since 2.6)
#
# @iops_size: an I/O size in bytes (Since 1.7)
#
Expand Down Expand Up @@ -582,11 +582,11 @@
# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
#
# @recording: true if the bitmap is recording new writes from the guest.
# Replaces ``active`` and ``disabled`` statuses. (since 4.0)
# (since 4.0)
#
# @busy: true if the bitmap is in-use by some operation (NBD or jobs)
# and cannot be modified via QMP or used by another operation.
# Replaces ``locked`` and ``frozen`` statuses. (since 4.0)
# (since 4.0)
#
# @persistent: true if the bitmap was stored on disk, is scheduled to be stored
# on disk, or both. (since 4.0)
Expand Down Expand Up @@ -948,7 +948,7 @@
# by the device (Since 4.2)
#
# @invalid_rd_operations: The number of invalid read operations
# performed by the device (Since 2.5)
# performed by the device (Since 2.5)
#
# @invalid_wr_operations: The number of invalid write operations
# performed by the device (Since 2.5)
Expand Down Expand Up @@ -1318,10 +1318,10 @@
# value is monotonically increasing.
#
# @busy: false if the job is known to be in a quiescent state, with
# no pending I/O. Since 1.3.
# no pending I/O. (Since 1.3)
#
# @paused: whether the job is paused or, if @busy is true, will
# pause itself as soon as possible. Since 1.3.
# pause itself as soon as possible. (Since 1.3)
#
# @speed: the rate limit, bytes per second
#
Expand Down Expand Up @@ -2741,7 +2741,7 @@
#
# @on-error: the action to take on an error (default report).
# 'stop' and 'enospc' can only be used if the block device
# supports io-status (see BlockInfo). Since 1.3.
# supports io-status (see BlockInfo). (Since 1.3)
#
# @filter-node-name: the node name that should be assigned to the
# filter driver that the stream job inserts into the graph
Expand Down Expand Up @@ -3735,7 +3735,7 @@
# Driver specific block device options for Quorum
#
# @blkverify: true if the driver must print content mismatch
# set to false by default
# set to false by default
#
# @children: the children block devices to use
#
Expand Down Expand Up @@ -4574,9 +4574,8 @@
#
# Since: 2.9
#
# Example:
# Examples:
#
# 1.
# -> { "execute": "blockdev-add",
# "arguments": {
# "driver": "qcow2",
Expand All @@ -4589,7 +4588,6 @@
# }
# <- { "return": {} }
#
# 2.
# -> { "execute": "blockdev-add",
# "arguments": {
# "driver": "qcow2",
Expand Down Expand Up @@ -5157,7 +5155,7 @@
# Driver specific image amend options for qcow2.
# For now, only encryption options can be amended
#
# @encrypt Encryption options to be amended
# @encrypt: Encryption options to be amended
#
# Since: 5.1
##
Expand Down Expand Up @@ -5596,7 +5594,7 @@
#
# Since: 2.7
#
# Example:
# Examples:
#
# 1. Add a new node to a quorum
# -> { "execute": "blockdev-add",
Expand Down Expand Up @@ -5646,7 +5644,7 @@
#
# Since: 2.12
#
# Example:
# Examples:
#
# 1. Move a node into an IOThread
# -> { "execute": "x-blockdev-set-iothread",
Expand Down Expand Up @@ -5731,18 +5729,18 @@
#
# Since: 2.0
#
# Example:
# Examples:
#
# 1. Read operation
#
# { "event": "QUORUM_REPORT_BAD",
# <- { "event": "QUORUM_REPORT_BAD",
# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
# "type": "read" },
# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
#
# 2. Flush operation
#
# { "event": "QUORUM_REPORT_BAD",
# <- { "event": "QUORUM_REPORT_BAD",
# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
# "type": "flush", "error": "Broken pipe" },
# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
Expand Down Expand Up @@ -5784,7 +5782,7 @@
# - If any snapshot matching @name exists, or @name is empty,
# GenericError
# - If the format of the image used does not support it,
# BlockFormatFeatureNotSupported
# GenericError
#
# Since: 1.7
#
Expand Down Expand Up @@ -5820,7 +5818,7 @@
# - 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
# GenericError
# - If @id and @name are both not specified, GenericError
#
# Since: 1.7
Expand Down
7 changes: 4 additions & 3 deletions qapi/block-export.json
Expand Up @@ -275,9 +275,10 @@
# @deprecated: This command is deprecated. Use @block-export-del instead.
#
# Returns: error if
# - the server is not running
# - export is not found
# - mode is 'safe' and there are existing connections
#
# - the server is not running
# - export is not found
# - mode is 'safe' and there are existing connections
#
# Since: 2.12
##
Expand Down
2 changes: 1 addition & 1 deletion qapi/block.json
Expand Up @@ -457,7 +457,7 @@
#
# Since: 1.1
#
# Example:
# Examples:
#
# -> { "execute": "block_set_io_throttle",
# "arguments": { "id": "virtio-blk-pci0/virtio-backend",
Expand Down
4 changes: 2 additions & 2 deletions qapi/char.json
Expand Up @@ -637,7 +637,7 @@
#
# Since: 1.4
#
# Example:
# Examples:
#
# -> { "execute" : "chardev-add",
# "arguments" : { "id" : "foo",
Expand Down Expand Up @@ -673,7 +673,7 @@
#
# Since: 2.10
#
# Example:
# Examples:
#
# -> { "execute" : "chardev-change",
# "arguments" : { "id" : "baz",
Expand Down
2 changes: 1 addition & 1 deletion qapi/control.json
Expand Up @@ -195,7 +195,7 @@
# @id: Name of the monitor
#
# @mode: Selects the monitor mode (default: readline in the system
# emulator, control in qemu-storage-daemon)
# emulator, control in qemu-storage-daemon)
#
# @pretty: Enables pretty printing (QMP only)
#
Expand Down
4 changes: 4 additions & 0 deletions qapi/cryptodev.json
Expand Up @@ -4,6 +4,10 @@
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.

##
# = Cryptography devices
##

##
# @QCryptodevBackendAlgType:
#
Expand Down
4 changes: 2 additions & 2 deletions qapi/job.json
Expand Up @@ -2,7 +2,7 @@
# vim: filetype=python

##
# == Background jobs
# = Background jobs
##

##
Expand Down Expand Up @@ -148,7 +148,7 @@
# This command returns immediately after resuming a paused job. Resuming an
# already running job is an error.
#
# @id : The job identifier.
# @id: The job identifier.
#
# Since: 3.0
##
Expand Down
2 changes: 1 addition & 1 deletion qapi/machine-target.json
Expand Up @@ -331,7 +331,7 @@
#
# Return a list of supported virtual CPU definitions
#
# Returns: a list of CpuDefInfo
# Returns: a list of CpuDefinitionInfo
#
# Since: 1.2
##
Expand Down