qapi doc generation (whole version, squashed)
v4 cover qapi doc generation (whole version, squashed)
Add a qapi2texi script to generate the documentation from the qapi schemas.
The 13th patch in this series is a squashed version of the documentation move from qmp-commands.txt to the schemas. The whole version (not sent on the ML to avoid spamming) is in the following git
branch: https://github.com/elmarco/qemu/commits/qapi-doc
v4:
- more device_add schema fixes
- do not merge docs/qmp-intro.txt in qemu-qmp-ref.texi
- remove needless @ifinfo, add GPL copying text
- added qemu logo to pdf
- added some r-b tags
v3:
- many improvements to the doc parser:
- throws an error in various malformated conditions
- allows multiple meta-sections, except for "Since:" and "Return:"
- build a list of docs, instead of attaching docs to expressions
- accept() breaks on new doc block, and get_doc() returns a QAPIDoc
- fix more documentation to fit the new parser
- use a master texi file that includes the generated file, instead of templated texi file
- texi fixes after Markus review
- only build and install html and man pages by default
- fix .gitignore
v2:
- change licence to be lgpl2+
- fix some comments & commit message
- add more code comments
- improve the doc parsing to treat only "Since" as a special case not requiring ":" (common notation in the doc)
- include some early schema doc fixes (to fix generated doc)
- include the squashed version of the doc move
- include the man page and installation build changes
Marc-André Lureau (15):
qapi: improve device_add schema
qga/schema: fix double-return in doc qga/schema: improve guest-set-vcpus Returns: section
qapi: fix schema symbol sections
qapi: fix missing symbol @prefix
qapi: fix various symbols mismatch in documentation
qapi: use one symbol per line
qapi: add missing colon-ending for section name
qapi: add some sections in docs
docs: add master qapi texi files
qapi: add qapi2texi script
texi2pod: learn quotation, deftp and deftypefn
qmp-commands: (SQUASHED) move doc to schema
docs: add qemu logo
build-sys: add qapi doc generation targets
Makefile | 57 +-
scripts/qapi.py | 175 +-
scripts/qapi2texi.py | 316 ++++
scripts/texi2pod.pl | 44 +-
.gitignore | 11 +-
docs/qapi-code-gen.txt | 44 +-
docs/qemu-ga-ref.texi | 82 +
docs/qemu-qmp-ref.texi | 82 +
docs/qemu_logo.pdf | Bin 0 -> 9117 bytes
{pc-bios => docs}/qemu_logo.svg | 0
docs/qmp-commands.txt | 3824 ---------------------------------------
docs/qmp-events.txt | 731 --------
docs/qmp-intro.txt | 3 +-
qapi-schema.json | 1623 +++++++++++++++--
qapi/block-core.json | 894 +++++++--
qapi/block.json | 82 +-
qapi/common.json | 52 +-
qapi/crypto.json | 41 +-
qapi/event.json | 304 +++-
qapi/introspect.json | 28 +-
qapi/rocker.json | 63 +-
qapi/trace.json | 25 +-
qga/qapi-schema.json | 64 +-
23 files changed, 3527 insertions(+), 5018 deletions(-)
create mode 100755 scripts/qapi2texi.py
create mode 100644 docs/qemu-ga-ref.texi
create mode 100644 docs/qemu-qmp-ref.texi
create mode 100644 docs/qemu_logo.pdf
rename {pc-bios => docs}/qemu_logo.svg (100%)
delete mode 100644 docs/qmp-commands.txt
delete mode 100644 docs/qmp-events.txtSignature · 1 line
2.10.0
PATCH v4 1/15 qapi: improve device_add schema
'device_add' is still incomplete for now, but we can fix a few arguments:
- 'bus' is a common argument, regardless of the device
- 'id' is an optionnal argument
--- qapi-schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qapi-schema.json +2 -2
@@ -2287,7 +2287,7 @@ # # @bus: #optional the device's parent bus (device tree path) # -# @id: the device's ID, must be unique +# @id: #optional the device's ID, must be unique # # Additional arguments depend on the type. #
@@ -2317,7 +2317,7 @@ # Since: 0.13 ## { 'command': 'device_add', - 'data': {'driver': 'str', 'id': 'str'}, + 'data': {'driver': 'str', '*bus': 'str', '*id': 'str'}, 'gen': false } # so we can get the additional arguments ##
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 01/15] qapi: improve device_add schema
Quoted 6 lines · Marc-André Lureau
'
device_add' is still incomplete for now, but we can fix a few arguments:
- 'bus' is a common argument, regardless of the device
- 'id' is an optionnal argumentSigned-off-by Marc-André Lureau <[email protected]>
Re: [Qemu-devel] [PATCH v4 01/15] qapi: improve device_add schema
Quoted 10 lines · Markus Armbruster
Quoted 6 lines · Marc-André Lureau
'
device_add' is still incomplete for now, but we can fix a few arguments:
- 'bus' is a common argument, regardless of the device
- 'id' is an optionnal argumentSigned-off-by Marc-André Lureau <[email protected]>Reviewed-by Markus Armbruster <[email protected]>
Wrong thread, please ignore.
PATCH v4 2/15 qga/schema: fix double-return in doc
In reply to Marc-André Lureauguest-get-memory-block-info documentation should have only one "Returns:".
--- qga/qapi-schema.json | 1 - 1 file changed, 1 deletion(-)
qga/qapi-schema.json +0 -1
@@ -952,7 +952,6 @@ # # Get information relating to guest memory blocks. # -# Returns: memory block size in bytes. # Returns: @GuestMemoryBlockInfo # # Since 2.3
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 02/15] qga/schema: fix double-return in doc
Quoted 5 lines · Marc-André Lureau
guest-get-memory-block-info documentation should have only one "Returns:".
Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>
Re: [Qemu-devel] [PATCH v4 02/15] qga/schema: fix double-return in doc
Quoted 9 lines · Markus Armbruster
Quoted 5 lines · Marc-André Lureau
guest-get-memory-block-info documentation should have only one "Returns:".
Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>Reviewed-by Markus Armbruster <[email protected]>
Wrong thread, please ignore.
PATCH v4 3/15 qga/schema: improve guest-set-vcpus Returns: section
In reply to Marc-André LureauThe documentation parser we are going to add finishes a section after an empty line.
Fix the Returns: section of guest-set-vcpus, and itemize the possible return values.
--- qga/qapi-schema.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
qga/qapi-schema.json +4 -8
@@ -696,22 +696,18 @@ # # 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 +# - 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 +# - 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, +# - < 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, -# -# length(@vcpus): call successful. +# - length(@vcpus): call successful. # # Since: 1.5 ##
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 03/15] qga/schema: improve guest-set-vcpus Returns: section
Quoted 2 lines · Marc-André Lureau
The documentation parser we are going to add finishes a section after an empty line.
Is this still true?
Quoted 29 lines
Fix the Returns: section of guest-set-vcpus, and itemize the possible return values.
Signed-off-by Marc-André Lureau <[email protected]>--- qga/qapi-schema.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)qga/qapi-schema.json +3
-6@@ -696,22 +696,18 @@ # # 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 +# - 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 +# - 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, +# - < length(@vcpus): more than zero initial nodes have been processed, # but not the entire @vcpus list. Guest state has
qga/qapi-schema.json line 713
Quoted 10 lines
qga/qapi-schema.json +1
-2# changed accordingly. To retrieve the error # (assuming it persists), repeat the call with the # successfully processed initial sublist removed. # Otherwise, -# -# length(@vcpus): call successful. +# - length(@vcpus): call successful. # # Since: 1.5 ##
Patch looks good.
Re: [Qemu-devel] [PATCH v4 03/15] qga/schema: improve guest-set-vcpus Returns: section
Quoted 6 lines · Markus Armbruster
Quoted 2 lines · Marc-André Lureau
The documentation parser we are going to add finishes a section after an empty line.
Is this still true?
Wrong thread, please ignore.
PATCH v4 4/15 qapi: fix schema symbol sections
In reply to Marc-André LureauAccording to docs/qapi-code-gen.txt, there needs to be '##' to start a and end a symbol section, that's also what the documentation parser expects.
--- qapi-schema.json | 18 +++++++++++++----- qapi/block-core.json | 1 + qga/qapi-schema.json | 3 +++ 3 files changed, 17 insertions(+), 5 deletions(-)
qapi-schema.json +13 -5
@@ -65,6 +65,7 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'merge', 'slew' ] } +## # @add_client # # Allow client connections for VNC, Spice and socket based
@@ -442,6 +443,7 @@ 'cache-miss': 'int', 'cache-miss-rate': 'number', 'overflow': 'int' } } +## # @MigrationStatus: # # An enumeration of migration status.
@@ -627,6 +629,7 @@ ## { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']} +## # @MigrationParameter # # Migration parameters enumeration
@@ -685,7 +688,7 @@ 'tls-creds', 'tls-hostname', 'max-bandwidth', 'downtime-limit', 'x-checkpoint-delay' ] } -# +## # @migrate-set-parameters # # Set various migration parameters. See MigrationParameters for details.
@@ -697,7 +700,7 @@ { 'command': 'migrate-set-parameters', 'boxed': true, 'data': 'MigrationParameters' } -# +## # @MigrationParameters # # Optional members can be omitted on input ('migrate-set-parameters')
@@ -795,6 +798,7 @@ # command. # # Since: 2.5 +## { 'command': 'migrate-start-postcopy' } ##
@@ -2252,6 +2256,7 @@ ## { 'command': 'migrate-incoming', 'data': {'uri': 'str' } } +## # @xen-save-devices-state: # # Save the state of all devices to file. The RAM and the block devices
@@ -3482,6 +3487,7 @@ 'modelb': 'CpuModelInfo' }, 'returns': 'CpuModelBaselineInfo' } +## # @AddfdInfo: # # Information about a file descriptor that was added to an fd set.
@@ -4530,14 +4536,16 @@ ## { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } -## @ACPISlotType +## +# @ACPISlotType # # @DIMM: memory slot # @CPU: logical CPU slot (since 2.7) -# +## { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } -## @ACPIOSTInfo +## +# @ACPIOSTInfo # # OSPM Status Indication for a device # For description of possible values of @source and @status fields
qapi/block-core.json +1 -0
@@ -2810,6 +2810,7 @@ 'offset': 'int', 'speed' : 'int' } } +## # @PreallocMode # # Preallocation mode of QEMU image file
qga/qapi-schema.json +3 -0
@@ -833,6 +833,7 @@ { 'command': 'guest-set-user-password', 'data': { 'username': 'str', 'password': 'str', 'crypted': 'bool' } } +## # @GuestMemoryBlock: # # @phys-index: Arbitrary guest-specific unique identifier of the MEMORY BLOCK.
@@ -932,6 +933,7 @@ 'data': {'mem-blks': ['GuestMemoryBlock'] }, 'returns': ['GuestMemoryBlockResponse'] } +## # @GuestMemoryBlockInfo: # # @size: the size (in bytes) of the guest memory blocks,
@@ -955,6 +957,7 @@ { 'command': 'guest-get-memory-block-info', 'returns': 'GuestMemoryBlockInfo' } +## # @GuestExecStatus: # # @exited: true if process has already terminated.
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 04/15] qapi: fix schema symbol sections
Quoted 6 lines · Marc-André Lureau
According to
docs/qapi-code-gen.txt, there needs to be '##' to start a and end a symbol section, that's also what the documentation parser expects.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>
Re: [Qemu-devel] [PATCH v4 04/15] qapi: fix schema symbol sections
Quoted 10 lines · Markus Armbruster
Quoted 6 lines · Marc-André Lureau
According to
docs/qapi-code-gen.txt, there needs to be '##' to start a and end a symbol section, that's also what the documentation parser expects.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>Reviewed-by Markus Armbruster <[email protected]>
Wrong thread, please ignore.
PATCH v4 5/15 qapi: fix missing symbol @prefix
In reply to Marc-André Lureau--- qapi-schema.json | 4 ++-- qapi/block-core.json | 4 ++-- qapi/crypto.json | 36 ++++++++++++++++++------------------ 3 files changed, 22 insertions(+), 22 deletions(-)
qapi-schema.json +2 -2
@@ -4650,7 +4650,7 @@ { 'include': 'qapi/rocker.json' } ## -# ReplayMode: +# @ReplayMode: # # Mode of the replay subsystem. #
@@ -4718,7 +4718,7 @@ { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] } ## -# CpuInstanceProperties +# @CpuInstanceProperties # # List of properties to be used for hotplugging a CPU instance, # it should be passed by management with device_add command when
qapi/block-core.json +2 -2
@@ -1144,7 +1144,7 @@ 'data': 'DriveMirror' } ## -# DriveMirror +# @DriveMirror # # A set of parameters describing drive mirror setup. #
@@ -1368,7 +1368,7 @@ 'data': 'BlockIOThrottle' } ## -# BlockIOThrottle +# @BlockIOThrottle # # A set of parameters describing block throttling. #
qapi/crypto.json +18 -18
@@ -3,7 +3,7 @@ # QAPI crypto definitions ## -# QCryptoTLSCredsEndpoint: +# @QCryptoTLSCredsEndpoint: # # The type of network endpoint that will be using the credentials. # Most types of credential require different setup / structures
@@ -22,7 +22,7 @@ ## -# QCryptoSecretFormat: +# @QCryptoSecretFormat: # # The data format that the secret is provided in #
@@ -36,7 +36,7 @@ ## -# QCryptoHashAlgorithm: +# @QCryptoHashAlgorithm: # # The supported algorithms for computing content digests #
@@ -55,7 +55,7 @@ ## -# QCryptoCipherAlgorithm: +# @QCryptoCipherAlgorithm: # # The supported algorithms for content encryption ciphers #
@@ -82,7 +82,7 @@ ## -# QCryptoCipherMode: +# @QCryptoCipherMode: # # The supported modes for content encryption ciphers #
@@ -98,7 +98,7 @@ ## -# QCryptoIVGenAlgorithm: +# @QCryptoIVGenAlgorithm: # # The supported algorithms for generating initialization # vectors for full disk encryption. The 'plain' generator
@@ -116,7 +116,7 @@ 'data': ['plain', 'plain64', 'essiv']} ## -# QCryptoBlockFormat: +# @QCryptoBlockFormat: # # The supported full disk encryption formats #
@@ -131,7 +131,7 @@ 'data': ['qcow', 'luks']} ## -# QCryptoBlockOptionsBase: +# @QCryptoBlockOptionsBase: # # The common options that apply to all full disk # encryption formats
@@ -144,7 +144,7 @@ 'data': { 'format': 'QCryptoBlockFormat' }} ## -# QCryptoBlockOptionsQCow: +# @QCryptoBlockOptionsQCow: # # The options that apply to QCow/QCow2 AES-CBC encryption format #
@@ -158,7 +158,7 @@ 'data': { '*key-secret': 'str' }} ## -# QCryptoBlockOptionsLUKS: +# @QCryptoBlockOptionsLUKS: # # The options that apply to LUKS encryption format #
@@ -172,7 +172,7 @@ ## -# QCryptoBlockCreateOptionsLUKS: +# @QCryptoBlockCreateOptionsLUKS: # # The options that apply to LUKS encryption format initialization #
@@ -202,7 +202,7 @@ ## -# QCryptoBlockOpenOptions: +# @QCryptoBlockOpenOptions: # # The options that are available for all encryption formats # when opening an existing volume
@@ -217,7 +217,7 @@ ## -# QCryptoBlockCreateOptions: +# @QCryptoBlockCreateOptions: # # The options that are available for all encryption formats # when initializing a new volume
@@ -232,7 +232,7 @@ ## -# QCryptoBlockInfoBase: +# @QCryptoBlockInfoBase: # # The common information that applies to all full disk # encryption formats
@@ -246,7 +246,7 @@ ## -# QCryptoBlockInfoLUKSSlot: +# @QCryptoBlockInfoLUKSSlot: # # Information about the LUKS block encryption key # slot options
@@ -266,7 +266,7 @@ ## -# QCryptoBlockInfoLUKS: +# @QCryptoBlockInfoLUKS: # # Information about the LUKS block encryption options #
@@ -294,7 +294,7 @@ 'slots': [ 'QCryptoBlockInfoLUKSSlot' ] }} ## -# QCryptoBlockInfoQCow: +# @QCryptoBlockInfoQCow: # # Information about the QCow block encryption options #
@@ -305,7 +305,7 @@ ## -# QCryptoBlockInfo: +# @QCryptoBlockInfo: # # Information about the block encryption options #
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 05/15] qapi: fix missing symbol @prefix
Quoted 2 lines · Marc-André Lureau
Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>
Re: [Qemu-devel] [PATCH v4 05/15] qapi: fix missing symbol @prefix
Quoted 6 lines · Markus Armbruster
Quoted 2 lines · Marc-André Lureau
Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Eric Blake <[email protected]>Reviewed-by Markus Armbruster <[email protected]>
Wrong thread, please ignore.
PATCH v4 6/15 qapi: fix various symbols mismatch in documentation
In reply to Marc-André LureauThere are various mismatch:
- invalid symbols
- section and member symbols mismatch
- enum or union values vs 'type'
The documentation parser catches all these cases.
--- qapi-schema.json | 20 +++++++++----------- qapi/block-core.json | 4 ---- qapi/common.json | 6 +++--- qapi/rocker.json | 2 +- qga/qapi-schema.json | 6 +++--- 5 files changed, 16 insertions(+), 22 deletions(-)
qapi-schema.json +9 -11
@@ -693,8 +693,6 @@ # # Set various migration parameters. See MigrationParameters for details. # -# @x-checkpoint-delay: the delay time between two checkpoints. (Since 2.8) -# # Since: 2.4 ## { 'command': 'migrate-set-parameters', 'boxed': true,
@@ -1171,7 +1169,7 @@ '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} } ## -# @VncPriAuth: +# @VncPrimaryAuth: # # vnc primary authentication method. #
@@ -3174,7 +3172,7 @@ # # @alias: #optional an alias for the machine name # -# @default: #optional whether the machine is default +# @is-default: #optional whether the machine is default # # @cpu-max: maximum number of CPUs supported by the machine type # (since 1.5.0)
@@ -3727,7 +3725,6 @@ # # @device: The name of the special file for the device, # i.e. /dev/ttyS0 on Unix or COM1: on Windows -# @type: What kind of device this is. # # Since: 1.4 ##
@@ -3992,7 +3989,7 @@ # # A union referencing different TPM backend types' configuration options # -# @passthrough: The configuration options for the TPM passthrough type +# @type: 'passthrough' The configuration options for the TPM passthrough type # # Since: 1.5 ##
@@ -4000,7 +3997,7 @@ 'data': { 'passthrough' : 'TPMPassthroughOptions' } } ## -# @TpmInfo: +# @TPMInfo: # # Information about the TPM #
@@ -4344,10 +4341,11 @@ # # Input event union. # -# @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 +# @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 # # Since: 2.0 ##
qapi/block-core.json +0 -4
@@ -2160,10 +2160,6 @@ # # @type: Transport type used for gluster connection # -# @unix: socket file -# -# @tcp: host address and port number -# # This is similar to SocketAddress, only distinction: # # 1. GlusterServer is a flat union, SocketAddress is a simple union.
qapi/common.json +3 -3
@@ -34,11 +34,11 @@ # # A three-part version number. # -# @qemu.major: The major version number. +# @major: The major version number. # -# @qemu.minor: The minor version number. +# @minor: The minor version number. # -# @qemu.micro: The micro version number. +# @micro: The micro version number. # # Since: 2.4 ##
qapi/rocker.json +1 -1
@@ -1,5 +1,5 @@ ## -# @Rocker: +# @RockerSwitch: # # Rocker switch information. #
qga/qapi-schema.json +3 -3
@@ -203,7 +203,7 @@ # # Open a file in the guest and retrieve a file handle for it # -# @filepath: Full path to the file in the guest to open. +# @path: Full path to the file in the guest to open. # # @mode: #optional open mode, as per fopen(), "r" is the default. #
@@ -378,7 +378,7 @@ 'data': { 'handle': 'int' } } ## -# @GuestFsFreezeStatus +# @GuestFsfreezeStatus # # An enumeration of filesystem freeze states #
@@ -766,7 +766,7 @@ # @GuestDiskAddress: # # @pci-controller: controller's PCI address -# @type: bus type +# @bus-type: bus type # @bus: bus id # @target: target id # @unit: unit id
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 06/15] qapi: fix various symbols mismatch in documentation
Quoted 8 lines · Marc-André Lureau
There are various mismatch:
- invalid symbols
- section and member symbols mismatch
- enum or union values vs 'type'The documentation parser catches all these cases.
Signed-off-by Marc-André Lureau <[email protected]>
Union documentation needs work, but that's out of scope for this patch.
Re: [Qemu-devel] [PATCH v4 06/15] qapi: fix various symbols mismatch in documentation
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Marc-André Lureau
There are various mismatch:
- invalid symbols
- section and member symbols mismatch
- enum or union values vs 'type'
Quoted 7 lines
Quoted 3 lines
The documentation parser catches all these cases.
Signed-off-by Marc-André Lureau <[email protected]>Union documentation needs work, but that's out of scope for this patch.
Reviewed-by Markus Armbruster <[email protected]>
Wrong thread, please ignore.
PATCH v4 7/15 qapi: use one symbol per line
In reply to Marc-André LureauThe documentation parser we are going to add only handles a single symbol per line.
--- qapi/block-core.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
qapi/block-core.json +6 -2
@@ -1712,9 +1712,13 @@ # # Drivers that are supported in block device operations. # -# @host_device, @host_cdrom: Since 2.1 +# @host_device: Since 2.1 +# @host_cdrom: Since 2.1 # @gluster: Since 2.7 -# @nbd, @nfs, @replication, @ssh: Since 2.8 +# @nbd: Since 2.8 +# @nfs: Since 2.8 +# @replication: Since 2.8 +# @ssh: Since 2.8 # # Since: 2.0 ##
Signature · 1 line
2.10.0
PATCH v4 8/15 qapi: add missing colon-ending for section name
In reply to Marc-André LureauThe documentation parser we are going to add expects a section name to end with ':', otherwise the comment is treated as free-form text body.
--- qapi-schema.json | 300 +++++++++++++++++++++++++-------------------------- qapi/block-core.json | 196 ++++++++++++++++----------------- qapi/block.json | 16 +-- qapi/common.json | 8 +- qapi/event.json | 58 +++++----- qapi/introspect.json | 28 ++--- qapi/trace.json | 8 +- qga/qapi-schema.json | 44 ++++---- 8 files changed, 329 insertions(+), 329 deletions(-)
qapi-schema.json +150 -150
@@ -66,7 +66,7 @@ 'data': ['discard', 'delay', 'merge', 'slew' ] } ## -# @add_client +# @add_client: # # Allow client connections for VNC, Spice and socket based # character devices to be passed in to QEMU via SCM_RIGHTS.
@@ -97,7 +97,7 @@ # # @name: #optional The name of the guest # -# Since 0.14.0 +# Since: 0.14.0 ## { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
@@ -108,7 +108,7 @@ # # Returns: @NameInfo of the guest # -# Since 0.14.0 +# Since: 0.14.0 ## { 'command': 'query-name', 'returns': 'NameInfo' }
@@ -137,7 +137,7 @@ { 'command': 'query-kvm', 'returns': 'KvmInfo' } ## -# @RunState +# @RunState: # # An enumeration of VM run states. #
@@ -235,7 +235,7 @@ # # Returns: The @UuidInfo for the guest # -# Since 0.14.0 +# Since: 0.14.0 ## { 'command': 'query-uuid', 'returns': 'UuidInfo' }
@@ -382,7 +382,7 @@ { 'command': 'query-events', 'returns': ['EventInfo'] } ## -# @MigrationStats +# @MigrationStats: # # Detailed migration status. #
@@ -396,7 +396,7 @@ # # @skipped: number of skipped zero pages (since 1.5) # -# @normal : number of normal pages (since 1.2) +# @normal: number of normal pages (since 1.2) # # @normal-bytes: number of normal bytes sent (since 1.2) #
@@ -420,7 +420,7 @@ 'postcopy-requests' : 'int' } } ## -# @XBZRLECacheStats +# @XBZRLECacheStats: # # Detailed XBZRLE migration cache statistics #
@@ -474,7 +474,7 @@ 'active', 'postcopy-active', 'completed', 'failed', 'colo' ] } ## -# @MigrationInfo +# @MigrationInfo: # # Information about current migration process. #
@@ -534,7 +534,7 @@ '*error-desc': 'str'} } ## -# @query-migrate +# @query-migrate: # # Returns information about current migration process. #
@@ -545,7 +545,7 @@ { 'command': 'query-migrate', 'returns': 'MigrationInfo' } ## -# @MigrationCapability +# @MigrationCapability: # # Migration capabilities enumeration #
@@ -593,7 +593,7 @@ 'compress', 'events', 'postcopy-ram', 'x-colo'] } ## -# @MigrationCapabilityStatus +# @MigrationCapabilityStatus: # # Migration capability information #
@@ -607,7 +607,7 @@ 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } } ## -# @migrate-set-capabilities +# @migrate-set-capabilities: # # Enable/Disable the following migration capabilities (like xbzrle) #
@@ -619,7 +619,7 @@ 'data': { 'capabilities': ['MigrationCapabilityStatus'] } } ## -# @query-migrate-capabilities +# @query-migrate-capabilities: # # Returns information about the current migration capabilities status #
@@ -630,7 +630,7 @@ { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']} ## -# @MigrationParameter +# @MigrationParameter: # # Migration parameters enumeration #
@@ -689,7 +689,7 @@ 'downtime-limit', 'x-checkpoint-delay' ] } ## -# @migrate-set-parameters +# @migrate-set-parameters: # # Set various migration parameters. See MigrationParameters for details. #
@@ -699,7 +699,7 @@ 'data': 'MigrationParameters' } ## -# @MigrationParameters +# @MigrationParameters: # # Optional members can be omitted on input ('migrate-set-parameters') # but most members will always be present on output
@@ -758,7 +758,7 @@ '*x-checkpoint-delay': 'int'} } ## -# @query-migrate-parameters +# @query-migrate-parameters: # # Returns information about the current migration parameters #
@@ -770,7 +770,7 @@ 'returns': 'MigrationParameters' } ## -# @client_migrate_info +# @client_migrate_info: # # Set migration information for remote display. This makes the server # ask the client to automatically reconnect using the new parameters
@@ -789,7 +789,7 @@ '*tls-port': 'int', '*cert-subject': 'str' } } ## -# @migrate-start-postcopy +# @migrate-start-postcopy: # # Followup to a migration command to switch the migration to postcopy mode. # The postcopy-ram capability must be set before the original migration
@@ -800,7 +800,7 @@ { 'command': 'migrate-start-postcopy' } ## -# @COLOMessage +# @COLOMessage: # # The message transmission between Primary side and Secondary side. #
@@ -826,7 +826,7 @@ 'vmstate-loaded' ] } ## -# @COLOMode +# @COLOMode: # # The colo mode #
@@ -842,7 +842,7 @@ 'data': [ 'unknown', 'primary', 'secondary'] } ## -# @FailoverStatus +# @FailoverStatus: # # An enumeration of COLO failover status #
@@ -860,7 +860,7 @@ 'data': [ 'none', 'require', 'active', 'completed'] } ## -# @x-colo-lost-heartbeat +# @x-colo-lost-heartbeat: # # Tell qemu that heartbeat is lost, request it to do takeover procedures. # If this command is sent to the PVM, the Primary side will exit COLO mode.
@@ -954,7 +954,7 @@ # # @pc: the 64-bit instruction pointer # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
@@ -967,7 +967,7 @@ # # @npc: the NPC component of the instruction pointer # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
@@ -978,7 +978,7 @@ # # @nip: the instruction pointer # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
@@ -989,7 +989,7 @@ # # @PC: the instruction pointer # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
@@ -1000,7 +1000,7 @@ # # @PC: the instruction pointer # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
@@ -1009,7 +1009,7 @@ # # No additional information is available about the virtual CPU # -# Since 2.6 +# Since: 2.6 # ## { 'struct': 'CpuInfoOther', 'data': { } }
@@ -1044,7 +1044,7 @@ # # Returns a list of information about each iothread. # -# Note this list excludes the QEMU main loop thread, which is not declared +# Note: this list excludes the QEMU main loop thread, which is not declared # using the -object iothread command-line option. It is always the main thread # of the process. #
@@ -1055,7 +1055,7 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] } ## -# @NetworkAddressFamily +# @NetworkAddressFamily: # # The network address family #
@@ -1075,7 +1075,7 @@ 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] } ## -# @VncBasicInfo +# @VncBasicInfo: # # The basic information for vnc network connection #
@@ -1098,7 +1098,7 @@ 'websocket': 'bool' } } ## -# @VncServerInfo +# @VncServerInfo: # # The network connection information for server #
@@ -1248,7 +1248,7 @@ { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] } ## -# @SpiceBasicInfo +# @SpiceBasicInfo: # # The basic information for SPICE network connection #
@@ -1266,7 +1266,7 @@ 'family': 'NetworkAddressFamily' } } ## -# @SpiceServerInfo +# @SpiceServerInfo: # # Information about a SPICE server #
@@ -1279,7 +1279,7 @@ 'data': { '*auth': 'str' } } ## -# @SpiceChannel +# @SpiceChannel: # # Information about a SPICE client channel. #
@@ -1304,7 +1304,7 @@ 'tls': 'bool'} } ## -# @SpiceQueryMouseMode +# @SpiceQueryMouseMode: # # An enumeration of Spice mouse states. #
@@ -1323,7 +1323,7 @@ 'data': [ 'client', 'server', 'unknown' ] } ## -# @SpiceInfo +# @SpiceInfo: # # Information about the SPICE session. #
@@ -1362,7 +1362,7 @@ 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} } ## -# @query-spice +# @query-spice: # # Returns information about the current SPICE server #
@@ -1412,7 +1412,7 @@ { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } ## -# @PciMemoryRegion +# @PciMemoryRegion: # # Information about a PCI device I/O region. #
@@ -1621,7 +1621,7 @@ { 'command': 'cpu', 'data': {'index': 'int'} } ## -# @cpu-add +# @cpu-add: # # Adds CPU with specified ID #
@@ -1629,7 +1629,7 @@ # # Returns: Nothing on success # -# Since 1.5 +# Since: 1.5 ## { 'command': 'cpu-add', 'data': {'id': 'int'} }
@@ -1760,17 +1760,17 @@ { 'command': 'balloon', 'data': {'value': 'int'} } ## -# @Abort +# @Abort: # # This action can be used to test transaction failure. # # Since: 1.6 -### +## { 'struct': 'Abort', 'data': { } } ## -# @ActionCompletionMode +# @ActionCompletionMode: # # An enumeration of Transactional completion modes. #
@@ -1790,12 +1790,12 @@ 'data': [ 'individual', 'grouped' ] } ## -# @TransactionAction +# @TransactionAction: # # A discriminated record of operations that can be performed with # @transaction. # -# Since 1.1 +# Since: 1.1 # # drive-backup since 1.6 # abort since 1.6
@@ -1818,7 +1818,7 @@ } } ## -# @TransactionProperties +# @TransactionProperties: # # Optional arguments to modify the behavior of a Transaction. #
@@ -1835,7 +1835,7 @@ } ## -# @transaction +# @transaction: # # Executes a number of transactionable QMP commands atomically. If any # operation fails, then the entire set of actions will be abandoned and the
@@ -1855,7 +1855,7 @@ # information on only one failed operation returned in an error condition, and # subsequent actions will not have been attempted. # -# Since 1.1 +# Since: 1.1 ## { 'command': 'transaction', 'data': { 'actions': [ 'TransactionAction' ],
@@ -1892,7 +1892,7 @@ 'returns': 'str' } ## -# @migrate_cancel +# @migrate_cancel: # # Cancel the current executing migration process. #
@@ -1905,7 +1905,7 @@ { 'command': 'migrate_cancel' } ## -# @migrate_set_downtime +# @migrate_set_downtime: # # Set maximum tolerated downtime for migration. #
@@ -1920,7 +1920,7 @@ { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} } ## -# @migrate_set_speed +# @migrate_set_speed: # # Set maximum speed for migration. #
@@ -1935,7 +1935,7 @@ { 'command': 'migrate_set_speed', 'data': {'value': 'int'} } ## -# @migrate-set-cache-size +# @migrate-set-cache-size: # # Set XBZRLE cache size #
@@ -1951,7 +1951,7 @@ { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} } ## -# @query-migrate-cache-size +# @query-migrate-cache-size: # # query XBZRLE cache size #
@@ -2216,7 +2216,7 @@ 'returns': [ 'DevicePropertyInfo' ] } ## -# @migrate +# @migrate: # # Migrates the current running guest to another Virtual Machine. #
@@ -2237,7 +2237,7 @@ 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } } ## -# @migrate-incoming +# @migrate-incoming: # # Start an incoming migration, the qemu must have been started # with -incoming defer
@@ -2271,7 +2271,7 @@ { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} } ## -# @xen-set-global-dirty-log +# @xen-set-global-dirty-log: # # Enable or disable the global dirty log mode. #
@@ -2363,7 +2363,7 @@ 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] } ## -# @dump-guest-memory +# @dump-guest-memory: # # Dump guest's memory to vmcore. It is a synchronous operation that can take # very long depending on the amount of guest memory.
@@ -2417,7 +2417,7 @@ '*format': 'DumpGuestMemoryFormat'} } ## -# @DumpStatus +# @DumpStatus: # # Describe the status of a long-running background guest memory dump. #
@@ -2429,13 +2429,13 @@ # # @failed: the last dump has failed. # -# Since 2.6 +# Since: 2.6 ## { 'enum': 'DumpStatus', 'data': [ 'none', 'active', 'completed', 'failed' ] } ## -# @DumpQueryResult +# @DumpQueryResult: # # The result format for 'query-dump'. #
@@ -2445,7 +2445,7 @@ # # @total: total bytes to be written in latest dump (uncompressed) # -# Since 2.6 +# Since: 2.6 ## { 'struct': 'DumpQueryResult', 'data': { 'status': 'DumpStatus',
@@ -2453,7 +2453,7 @@ 'total': 'int' } } ## -# @query-dump +# @query-dump: # # Query latest dump status. #
@@ -2488,7 +2488,7 @@ 'returns': 'DumpGuestMemoryCapability' } ## -# @dump-skeys +# @dump-skeys: # # Dump guest's storage keys #
@@ -2575,17 +2575,17 @@ { 'command': 'object-del', 'data': {'id': 'str'} } ## -# @NetdevNoneOptions +# @NetdevNoneOptions: # # Use it alone to have zero network devices. # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevNoneOptions', 'data': { } } ## -# @NetLegacyNicOptions +# @NetLegacyNicOptions: # # Create a new Network Interface Card. #
@@ -2599,7 +2599,7 @@ # # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetLegacyNicOptions', 'data': {
@@ -2610,18 +2610,18 @@ '*vectors': 'uint32' } } ## -# @String +# @String: # # A fat type wrapping 'str', to be embedded in lists. # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'String', 'data': { 'str': 'str' } } ## -# @NetdevUserOptions +# @NetdevUserOptions: # # Use the user mode network stack which requires no administrator privilege to # run.
@@ -2678,7 +2678,7 @@ # # @guestfwd: #optional forward guest TCP connections # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevUserOptions', 'data': {
@@ -2704,7 +2704,7 @@ '*guestfwd': ['String'] } } ## -# @NetdevTapOptions +# @NetdevTapOptions: # # Connect the host TAP network interface name to the VLAN. #
@@ -2741,7 +2741,7 @@ # @poll-us: #optional maximum number of microseconds that could # be spent on busy polling for tap (since 2.7) # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevTapOptions', 'data': {
@@ -2762,7 +2762,7 @@ '*poll-us': 'uint32'} } ## -# @NetdevSocketOptions +# @NetdevSocketOptions: # # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP # socket connection.
@@ -2779,7 +2779,7 @@ # # @udp: #optional UDP unicast address and port number # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevSocketOptions', 'data': {
@@ -2791,7 +2791,7 @@ '*udp': 'str' } } ## -# @NetdevL2TPv3Options +# @NetdevL2TPv3Options: # # Connect the VLAN to Ethernet over L2TPv3 Static tunnel #
@@ -2827,7 +2827,7 @@ # @offset: #optional additional offset - allows the insertion of # additional application-specific data before the packet payload # -# Since 2.1 +# Since: 2.1 ## { 'struct': 'NetdevL2TPv3Options', 'data': {
@@ -2847,7 +2847,7 @@ '*offset': 'uint32' } } ## -# @NetdevVdeOptions +# @NetdevVdeOptions: # # Connect the VLAN to a vde switch running on the host. #
@@ -2859,7 +2859,7 @@ # # @mode: #optional permissions for socket # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevVdeOptions', 'data': {
@@ -2869,7 +2869,7 @@ '*mode': 'uint16' } } ## -# @NetdevDumpOptions +# @NetdevDumpOptions: # # Dump VLAN network traffic to a file. #
@@ -2878,7 +2878,7 @@ # # @file: #optional dump file path (default is qemu-vlan0.pcap) # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevDumpOptions', 'data': {
@@ -2886,7 +2886,7 @@ '*file': 'str' } } ## -# @NetdevBridgeOptions +# @NetdevBridgeOptions: # # Connect a host TAP network interface to a host bridge device. #
@@ -2894,7 +2894,7 @@ # # @helper: #optional command to execute to configure bridge # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevBridgeOptions', 'data': {
@@ -2902,20 +2902,20 @@ '*helper': 'str' } } ## -# @NetdevHubPortOptions +# @NetdevHubPortOptions: # # Connect two or more net clients through a software hub. # # @hubid: hub identifier number # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetdevHubPortOptions', 'data': { 'hubid': 'int32' } } ## -# @NetdevNetmapOptions +# @NetdevNetmapOptions: # # Connect a client to a netmap-enabled NIC or to a VALE switch port #
@@ -2928,7 +2928,7 @@ # # @devname: #optional path of the netmap device (default: '/dev/netmap'). # -# Since 2.0 +# Since: 2.0 ## { 'struct': 'NetdevNetmapOptions', 'data': {
@@ -2936,7 +2936,7 @@ '*devname': 'str' } } ## -# @NetdevVhostUserOptions +# @NetdevVhostUserOptions: # # Vhost-user network backend #
@@ -2947,7 +2947,7 @@ # @queues: #optional number of queues to be created for multiqueue vhost-user # (default: 1) (Since 2.5) # -# Since 2.1 +# Since: 2.1 ## { 'struct': 'NetdevVhostUserOptions', 'data': {
@@ -2956,18 +2956,18 @@ '*queues': 'int' } } ## -# @NetClientDriver +# @NetClientDriver: # # Available netdev drivers. # -# Since 2.7 +# Since: 2.7 ## { 'enum': 'NetClientDriver', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump', 'bridge', 'hubport', 'netmap', 'vhost-user' ] } ## -# @Netdev +# @Netdev: # # Captures the configuration of a network device. #
@@ -2975,7 +2975,7 @@ # # @type: Specify the driver used for interpreting remaining arguments. # -# Since 1.2 +# Since: 1.2 # # 'l2tpv3' - since 2.1 ##
@@ -2997,7 +2997,7 @@ 'vhost-user': 'NetdevVhostUserOptions' } } ## -# @NetLegacy +# @NetLegacy: # # Captures the configuration of a network device; legacy. #
@@ -3009,7 +3009,7 @@ # # @opts: device type specific properties (legacy) # -# Since 1.2 +# Since: 1.2 ## { 'struct': 'NetLegacy', 'data': {
@@ -3019,11 +3019,11 @@ 'opts': 'NetLegacyOptions' } } ## -# @NetLegacyOptions +# @NetLegacyOptions: # # Like Netdev, but for use only by the legacy command line options # -# Since 1.2 +# Since: 1.2 ## { 'union': 'NetLegacyOptions', 'data': {
@@ -3040,7 +3040,7 @@ 'vhost-user': 'NetdevVhostUserOptions' } } ## -# @NetFilterDirection +# @NetFilterDirection: # # Indicates whether a netfilter is attached to a netdev's transmit queue or # receive queue or both.
@@ -3054,13 +3054,13 @@ # @tx: the filter is attached to the transmit queue of the netdev, # where it will receive packets sent by the netdev. # -# Since 2.5 +# Since: 2.5 ## { 'enum': 'NetFilterDirection', 'data': [ 'all', 'rx', 'tx' ] } ## -# @InetSocketAddress +# @InetSocketAddress: # # Captures a socket address or address range in the Internet namespace. #
@@ -3076,7 +3076,7 @@ # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6 # #optional # -# Since 1.3 +# Since: 1.3 ## { 'struct': 'InetSocketAddress', 'data': {
@@ -3087,30 +3087,30 @@ '*ipv6': 'bool' } } ## -# @UnixSocketAddress +# @UnixSocketAddress: # # Captures a socket address in the local ("Unix socket") namespace. # # @path: filesystem path to use # -# Since 1.3 +# Since: 1.3 ## { 'struct': 'UnixSocketAddress', 'data': { 'path': 'str' } } ## -# @VsockSocketAddress +# @VsockSocketAddress: # # Captures a socket address in the vsock namespace. # # @cid: unique host identifier # @port: port # -# Note that string types are used to allow for possible future hostname or +# Note: string types are used to allow for possible future hostname or # service resolution support. # -# Since 2.8 +# Since: 2.8 ## { 'struct': 'VsockSocketAddress', 'data': {
@@ -3118,11 +3118,11 @@ 'port': 'str' } } ## -# @SocketAddress +# @SocketAddress: # # Captures the address of a socket, which could also be a named file descriptor # -# Since 1.3 +# Since: 1.3 ## { 'union': 'SocketAddress', 'data': {
@@ -3273,7 +3273,7 @@ '*props': 'any' } } ## -# @CpuModelExpansionType +# @CpuModelExpansionType: # # An enumeration of CPU model expansion types. #
@@ -3296,7 +3296,7 @@ ## -# @CpuModelExpansionInfo +# @CpuModelExpansionInfo: # # The result of a cpu model expansion. #
@@ -3370,7 +3370,7 @@ 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] } ## -# @CpuModelCompareInfo +# @CpuModelCompareInfo: # # The result of a CPU model comparison. #
@@ -3434,7 +3434,7 @@ 'returns': 'CpuModelCompareInfo' } ## -# @CpuModelBaselineInfo +# @CpuModelBaselineInfo: # # The result of a CPU model baseline. #
@@ -3640,7 +3640,7 @@ 'kp_comma', 'kp_equals', 'power' ] } ## -# @KeyValue +# @KeyValue: # # Represents a keyboard key. #
@@ -4026,7 +4026,7 @@ { 'command': 'query-tpm', 'returns': ['TPMInfo'] } ## -# @AcpiTableOptions +# @AcpiTableOptions: # # Specify an ACPI table on the command line to load. #
@@ -4069,7 +4069,7 @@ # ACPI table header. At least one file is required. This field excludes # @file. # -# Since 1.5 +# Since: 1.5 ## { 'struct': 'AcpiTableOptions', 'data': {
@@ -4097,7 +4097,7 @@ # @size: accepts a number followed by an optional suffix (K)ilo, # (M)ega, (G)iga, (T)era # -# Since 1.5 +# Since: 1.5 ## { 'enum': 'CommandLineParameterType', 'data': ['string', 'boolean', 'number', 'size'] }
@@ -4115,7 +4115,7 @@ # # @default: #optional default value string (since 2.1) # -# Since 1.5 +# Since: 1.5 ## { 'struct': 'CommandLineParameterInfo', 'data': { 'name': 'str',
@@ -4132,7 +4132,7 @@ # # @parameters: an array of @CommandLineParameterInfo # -# Since 1.5 +# Since: 1.5 ## { 'struct': 'CommandLineOptionInfo', 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
@@ -4147,13 +4147,13 @@ # Returns: list of @CommandLineOptionInfo for all options (or for the given # @option). Returns an error if the given @option doesn't exist. # -# Since 1.5 +# Since: 1.5 ## {'command': 'query-command-line-options', 'data': { '*option': 'str' }, 'returns': ['CommandLineOptionInfo'] } ## -# @X86CPURegister32 +# @X86CPURegister32: # # A X86 32-bit register #
@@ -4163,7 +4163,7 @@ 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] } ## -# @X86CPUFeatureWordInfo +# @X86CPUFeatureWordInfo: # # Information about a X86 CPU feature word #
@@ -4185,11 +4185,11 @@ 'features': 'int' } } ## -# @DummyForceArrays +# @DummyForceArrays: # # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally # -# Since 2.5 +# Since: 2.5 ## { 'struct': 'DummyForceArrays', 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
@@ -4239,7 +4239,7 @@ # # @multicast-table: a list of multicast macaddr string # -# Since 1.6 +# Since: 1.6 ## { 'struct': 'RxFilterInfo', 'data': {
@@ -4274,7 +4274,7 @@ 'returns': ['RxFilterInfo'] } ## -# @InputButton +# @InputButton: # # Button of a pointer input device (mouse, tablet). #
@@ -4284,7 +4284,7 @@ 'data' : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down' ] } ## -# @InputAxis +# @InputAxis: # # Position axis of a pointer input device (mouse, tablet). #
@@ -4294,7 +4294,7 @@ 'data' : [ 'x', 'y' ] } ## -# @InputKeyEvent +# @InputKeyEvent: # # Keyboard input event. #
@@ -4308,7 +4308,7 @@ 'down' : 'bool' } } ## -# @InputBtnEvent +# @InputBtnEvent: # # Pointer button input event. #
@@ -4322,7 +4322,7 @@ 'down' : 'bool' } } ## -# @InputMoveEvent +# @InputMoveEvent: # # Pointer motion input event. #
@@ -4337,7 +4337,7 @@ 'value' : 'int' } } ## -# @InputEvent +# @InputEvent: # # Input event union. #
@@ -4356,7 +4356,7 @@ 'abs' : 'InputMoveEvent' } } ## -# @input-send-event +# @input-send-event: # # Send input event(s) to guest. #
@@ -4386,18 +4386,18 @@ 'events' : [ 'InputEvent' ] } } ## -# @NumaOptions +# @NumaOptions: # # A discriminated record of NUMA options. (for OptsVisitor) # -# Since 2.1 +# Since: 2.1 ## { 'union': 'NumaOptions', 'data': { 'node': 'NumaNodeOptions' }} ## -# @NumaNodeOptions +# @NumaNodeOptions: # # Create a guest NUMA node. (for OptsVisitor) #
@@ -4423,7 +4423,7 @@ '*memdev': 'str' }} ## -# @HostMemPolicy +# @HostMemPolicy: # # Host memory policy types #
@@ -4437,7 +4437,7 @@ # @interleave: memory allocations are interleaved across the set # of host nodes specified # -# Since 2.1 +# Since: 2.1 ## { 'enum': 'HostMemPolicy', 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
@@ -4526,7 +4526,7 @@ { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} } ## -# @query-memory-devices +# @query-memory-devices: # # Lists available memory devices and their state #
@@ -4535,7 +4535,7 @@ { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } ## -# @ACPISlotType +# @ACPISlotType: # # @DIMM: memory slot # @CPU: logical CPU slot (since 2.7)
@@ -4543,7 +4543,7 @@ { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } ## -# @ACPIOSTInfo +# @ACPIOSTInfo: # # OSPM Status Indication for a device # For description of possible values of @source and @status fields
@@ -4569,7 +4569,7 @@ 'status': 'int' } } ## -# @query-acpi-ospm-status +# @query-acpi-ospm-status: # # Lists ACPI OSPM status of ACPI device objects, # which might be reported via _OST method
@@ -4579,7 +4579,7 @@ { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } ## -# @WatchdogExpirationAction +# @WatchdogExpirationAction: # # An enumeration of the actions taken when the watchdog device's timer is # expired
@@ -4607,7 +4607,7 @@ 'inject-nmi' ] } ## -# @IoOperationType +# @IoOperationType: # # An enumeration of the I/O operation types #
@@ -4621,7 +4621,7 @@ 'data': [ 'read', 'write' ] } ## -# @GuestPanicAction +# @GuestPanicAction: # # An enumeration of the actions taken when guest OS panic is detected #
@@ -4633,7 +4633,7 @@ 'data': [ 'pause', 'poweroff' ] } ## -# @rtc-reset-reinjection +# @rtc-reset-reinjection: # # This command will reset the RTC interrupt reinjection backlog. # Can be used if another mechanism to synchronize guest time
@@ -4716,7 +4716,7 @@ { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] } ## -# @CpuInstanceProperties +# @CpuInstanceProperties: # # List of properties to be used for hotplugging a CPU instance, # it should be passed by management with device_add command when
@@ -4744,7 +4744,7 @@ } ## -# @HotpluggableCPU +# @HotpluggableCPU: # # @type: CPU object type for usage with device_add command # @props: list of properties to be used for hotplugging CPU
@@ -4763,7 +4763,7 @@ } ## -# @query-hotpluggable-cpus +# @query-hotpluggable-cpus: # # Returns: a list of HotpluggableCPU objects. #
qapi/block-core.json +98 -98
743 lines not on this page · raw message
qapi/block.json +8 -8
@@ -40,7 +40,7 @@ 'data': ['auto', 'none', 'lba', 'large', 'rechs']} ## -# @FloppyDriveType +# @FloppyDriveType: # # Type of Floppy drive to be emulated by the Floppy Disk Controller. #
@@ -56,7 +56,7 @@ 'data': ['144', '288', '120', 'none', 'auto']} ## -# @BlockdevSnapshotInternal +# @BlockdevSnapshotInternal: # # @device: the device name or node-name of a root node to generate the snapshot # from
@@ -73,7 +73,7 @@ 'data': { 'device': 'str', 'name': 'str' } } ## -# @blockdev-snapshot-internal-sync +# @blockdev-snapshot-internal-sync: # # Synchronously take an internal snapshot of a block device, when the format # of the image used supports it.
@@ -87,13 +87,13 @@ # If the format of the image used does not support it, # BlockFormatFeatureNotSupported # -# Since 1.7 +# Since: 1.7 ## { 'command': 'blockdev-snapshot-internal-sync', 'data': 'BlockdevSnapshotInternal' } ## -# @blockdev-snapshot-delete-internal-sync +# @blockdev-snapshot-delete-internal-sync: # # Synchronously delete an internal snapshot of a block device, when the format # of the image used support it. The snapshot is identified by name or id or
@@ -114,7 +114,7 @@ # BlockFormatFeatureNotSupported # If @id and @name are both not specified, GenericError # -# Since 1.7 +# Since: 1.7 ## { 'command': 'blockdev-snapshot-delete-internal-sync', 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
@@ -190,7 +190,7 @@ { 'command': 'nbd-server-stop' } ## -# @DEVICE_TRAY_MOVED +# @DEVICE_TRAY_MOVED: # # Emitted whenever the tray of a removable device is moved by the guest or by # HMP/QMP commands
@@ -209,7 +209,7 @@ 'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } } ## -# @QuorumOpType +# @QuorumOpType: # # An enumeration of the quorum operation types #
qapi/common.json +4 -4
@@ -3,7 +3,7 @@ # QAPI common definitions ## -# @QapiErrorClass +# @QapiErrorClass: # # QEMU error classes #
@@ -30,7 +30,7 @@ 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } ## -# @VersionTriple +# @VersionTriple: # # A three-part version number. #
@@ -101,7 +101,7 @@ { 'command': 'query-commands', 'returns': ['CommandInfo'] } ## -# @OnOffAuto +# @OnOffAuto: # # An enumeration of three options: on, off, and auto #
@@ -117,7 +117,7 @@ 'data': [ 'auto', 'on', 'off' ] } ## -# @OnOffSplit +# @OnOffSplit: # # An enumeration of three values: on, off, and split #
qapi/event.json +29 -29
230 lines not on this page · raw message
qapi/introspect.json +14 -14
@@ -11,7 +11,7 @@ # See the COPYING file in the top-level directory. ## -# @query-qmp-schema +# @query-qmp-schema: # # Command query-qmp-schema exposes the QMP wire ABI as an array of # SchemaInfo. This lets QMP clients figure out what commands and
@@ -49,7 +49,7 @@ 'gen': false } # just to simplify qmp_query_json() ## -# @SchemaMetaType +# @SchemaMetaType: # # This is a @SchemaInfo's meta type, i.e. the kind of entity it # describes.
@@ -75,7 +75,7 @@ 'command', 'event' ] } ## -# @SchemaInfo +# @SchemaInfo: # # @name: the entity's name, inherited from @base. # Commands and events have the name defined in the QAPI schema.
@@ -105,7 +105,7 @@ 'event': 'SchemaInfoEvent' } } ## -# @SchemaInfoBuiltin +# @SchemaInfoBuiltin: # # Additional SchemaInfo members for meta-type 'builtin'. #
@@ -117,7 +117,7 @@ 'data': { 'json-type': 'JSONType' } } ## -# @JSONType +# @JSONType: # # The four primitive and two structured types according to RFC 7159 # section 1, plus 'int' (split off 'number'), plus the obvious top
@@ -130,7 +130,7 @@ 'object', 'array', 'value' ] } ## -# @SchemaInfoEnum +# @SchemaInfoEnum: # # Additional SchemaInfo members for meta-type 'enum'. #
@@ -144,7 +144,7 @@ 'data': { 'values': ['str'] } } ## -# @SchemaInfoArray +# @SchemaInfoArray: # # Additional SchemaInfo members for meta-type 'array'. #
@@ -158,7 +158,7 @@ 'data': { 'element-type': 'str' } } ## -# @SchemaInfoObject +# @SchemaInfoObject: # # Additional SchemaInfo members for meta-type 'object'. #
@@ -183,7 +183,7 @@ '*variants': [ 'SchemaInfoObjectVariant' ] } } ## -# @SchemaInfoObjectMember +# @SchemaInfoObjectMember: # # An object member. #
@@ -206,7 +206,7 @@ # @default's type must be null or match @type ## -# @SchemaInfoObjectVariant +# @SchemaInfoObjectVariant: # # The variant members for a value of the type tag. #
@@ -221,7 +221,7 @@ 'data': { 'case': 'str', 'type': 'str' } } ## -# @SchemaInfoAlternate +# @SchemaInfoAlternate: # # Additional SchemaInfo members for meta-type 'alternate'. #
@@ -237,7 +237,7 @@ 'data': { 'members': [ 'SchemaInfoAlternateMember' ] } } ## -# @SchemaInfoAlternateMember +# @SchemaInfoAlternateMember: # # An alternate member. #
@@ -249,7 +249,7 @@ 'data': { 'type': 'str' } } ## -# @SchemaInfoCommand +# @SchemaInfoCommand: # # Additional SchemaInfo members for meta-type 'command'. #
@@ -266,7 +266,7 @@ 'data': { 'arg-type': 'str', 'ret-type': 'str' } } ## -# @SchemaInfoEvent +# @SchemaInfoEvent: # # Additional SchemaInfo members for meta-type 'event'. #
qapi/trace.json +4 -4
@@ -17,7 +17,7 @@ # # @enabled: The event is dynamically enabled. # -# Since 2.2 +# Since: 2.2 ## { 'enum': 'TraceEventState', 'data': ['unavailable', 'disabled', 'enabled'] }
@@ -34,7 +34,7 @@ # An event is per-vCPU if it has the "vcpu" property in the "trace-events" # files. # -# Since 2.2 +# Since: 2.2 ## { 'struct': 'TraceEventInfo', 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} }
@@ -58,7 +58,7 @@ # exact match, @vcpu is given and the event does not have the "vcpu" property, # an error is returned. # -# Since 2.2 +# Since: 2.2 ## { 'command': 'trace-event-get-state', 'data': {'name': 'str', '*vcpu': 'int'},
@@ -83,7 +83,7 @@ # match, @vcpu is given and the event does not have the "vcpu" property, an # error is returned. # -# Since 2.2 +# Since: 2.2 ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool',
qga/qapi-schema.json +22 -22
175 lines not on this page · raw message
Signature · 1 line
2.10.0
PATCH v4 9/15 qapi: add some sections in docs
In reply to Marc-André LureauAdd some more section titles to organize the produced documents.
--- qapi-schema.json | 4 ++++ qapi/block-core.json | 6 ++++-- qapi/block.json | 10 ++++++++-- qapi/common.json | 6 ++++-- qapi/crypto.json | 5 ++++- qapi/event.json | 6 ++++++ qapi/rocker.json | 4 ++++ qapi/trace.json | 3 +++ 8 files changed, 37 insertions(+), 7 deletions(-)
qapi-schema.json +4 -0
@@ -20,6 +20,10 @@ # QAPI introspection { 'include': 'qapi/introspect.json' } +## +# = QMP commands +## + ## # @qmp_capabilities: #
qapi/block-core.json +4 -2
@@ -1,6 +1,8 @@ # -*- Mode: Python -*- -# -# QAPI block core definitions (vm unrelated) + +## +# == QAPI block core definitions (vm unrelated) +## # QAPI common definitions { 'include': 'common.json' }
qapi/block.json +8 -2
@@ -1,10 +1,16 @@ # -*- Mode: Python -*- -# -# QAPI block definitions (vm related) + +## +# = QAPI block definitions +## # QAPI block core definitions { 'include': 'block-core.json' } +## +# == QAPI block definitions (vm unrelated) +## + ## # @BiosAtaTranslation: #
qapi/common.json +4 -2
@@ -1,6 +1,8 @@ # -*- Mode: Python -*- -# -# QAPI common definitions + +## +# = QAPI common definitions +## ## # @QapiErrorClass:
qapi/crypto.json +4 -1
@@ -1,6 +1,9 @@ # -*- Mode: Python -*- # -# QAPI crypto definitions + +## +# = QAPI crypto definitions +## ## # @QCryptoTLSCredsEndpoint:
qapi/event.json +6 -0
@@ -1,3 +1,9 @@ +# -*- Mode: Python -*- + +## +# = Events +## + ## # @SHUTDOWN: #
qapi/rocker.json +4 -0
@@ -1,4 +1,8 @@ ## +# = Rocker API +## + +## # @RockerSwitch: # # Rocker switch information.
qapi/trace.json +3 -0
@@ -5,6 +5,9 @@ # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. +## +# = Tracing commands +## ## # @TraceEventState:
Signature · 1 line
2.10.0
PATCH v4 10/15 docs: add master qapi texi files
In reply to Marc-André LureauThe qapi2texi script generates a file to be included in a texi file. Add "QEMU QMP Reference Manual" and "QEMU Guest Agent Protocol Reference" master texi files.
--- docs/qemu-ga-ref.texi | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/qemu-qmp-ref.texi | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 docs/qemu-ga-ref.texi create mode 100644 docs/qemu-qmp-ref.texi
docs/qemu-ga-ref.texi new file +78 -0
@@ -0,0 +1,78 @@ +\input texinfo +@setfilename qemu-ga-ref.info + +@exampleindent 0 +@paragraphindent 0 + +@settitle QEMU Guest Agent Protocol Reference + +@copying +This is the QEMU Guest Agent Protocol reference manual. + +Copyright @copyright{} 2016 The QEMU Project developers + +@quotation +This manual is free documentation: you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, either version 2 of the +License, or (at your option) any later version. + +This manual is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this manual. If not, see http://www.gnu.org/licenses/. +@end quotation +@end copying + +@dircategory QEMU +@direntry +* QEMU-GA-Ref: (qemu-ga-ref). QEMU Guest Agent Protocol Reference +@end direntry + +@titlepage +@title Guest Agent Protocol Reference Manual +@subtitle QEMU version @value{VERSION} +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@contents + +@ifnottex +@node Top +@top QEMU Guest Agent protocol reference +@end ifnottex + +@menu +* API Reference:: +* Commands and Events Index:: +* Data Types Index:: +@end menu + +@node API Reference +@chapter API Reference + +@c for texi2pod: +@c man begin DESCRIPTION + +@include qemu-ga-qapi.texi + +@c man end + +@c man begin SEEALSO +The HTML documentation of QEMU for more information. +@c man end + +@node Commands and Events Index +@unnumbered Commands and Events Index +@printindex fn + +@node Data Types Index +@unnumbered Data Types Index +@printindex tp + +@bye
docs/qemu-qmp-ref.texi new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
2.10.0
PATCH v4 11/15 qapi: add qapi2texi script
In reply to Marc-André LureauAs the name suggests, the qapi2texi script converts JSON QAPI description into a texi file suitable for different target formats (info/man/txt/pdf/html...).
It parses the following kind of blocks:
Free-form:
##
# = Section
# == Subsection
#
# Some text foo with *emphasis*
# 1. with a list
# 2. like that
#
# And some code:
# | $ echo foo # | -> do this # | <- get that
#
##
Symbol:
##
# @symbol:
#
# Symbol body ditto ergo sum. Foo bar
# baz ding.
#
# @arg: foo
# @arg: #optional foo
#
# Returns: returns bla bla
# Or bla blah
#
# Since: version
# Notes: notes, comments can have
# - itemized list
# - like this
#
# Example:
#
# -> { "execute": "quit" }
# <- { "return": {} }
#
##That's roughly following the following BNF grammar:
api_comment = "##\n" comment "##\n"
comment = freeform_comment | symbol_commentfreeform_comment = { "#" text "\n" }symbol_comment = "#" "@" name ":\n" { freeform | member | meta }
member = "#" '@' name ':' [ text ] freeform_comment
meta = "#" ( "Returns:", "Since:", "Note:", "Notes:", "Example:", "Examples:" ) [ text ] freeform_comment text = free-text markdown-like, "#optional" for members
Thanks to the following json expressions, the documentation is enhanced with extra information about the type of arguments and return value expected.
--- scripts/qapi.py | 175 ++++++++++++++++++++++++++- scripts/qapi2texi.py | 316 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/qapi-code-gen.txt | 44 +++++-- 3 files changed, 524 insertions(+), 11 deletions(-) create mode 100755 scripts/qapi2texi.py
scripts/qapi.py +174 -1
@@ -122,6 +122,103 @@ class QAPIExprError(Exception): "%s:%d: %s" % (self.info['file'], self.info['line'], self.msg) +class QAPIDoc(object): + def __init__(self, parser): + self.parser = parser + self.symbol = None + self.body = [] + # args is {'arg': 'doc', ...} + self.args = OrderedDict() + # meta is [(Since/Notes/Examples/Returns:, 'doc'), ...] + self.meta = [] + # the current section to populate, array of [dict, key, comment...] + self.section = None + self.expr_elem = None + + def get_body(self): + return "\n".join(self.body) + + def has_meta(self, name): + """Returns True if the doc has a meta section 'name'""" + return next((True for i in self.meta if i[0] == name), False) + + def append(self, line): + """Adds a # comment line, to be parsed and added in a section""" + line = line[1:] + if len(line) == 0: + self._append_section(line) + return + + if line[0] != ' ': + raise QAPISchemaError(self.parser, "missing space after #") + + line = line[1:] + # take the first word out + name = line.split(' ', 1)[0] + if name.startswith("@") and name.endswith(":"): + line = line[len(name):] + name = name[1:-1] + if self.symbol is None: + # the first is the symbol this APIDoc object documents + if len(self.body): + raise QAPISchemaError(self.parser, "symbol must come first") + self.symbol = name + else: + # else an arg + self._start_args_section(name) + elif self.symbol and name in ( + "Returns:", "Since:", + # those are often singular or plural + "Note:", "Notes:", + "Example:", "Examples:"): + # new "meta" section + line = line[len(name):] + self._start_meta_section(name[:-1]) + + self._append_section(line) + + def _start_args_section(self, name): + self.end_section() + if self.args.has_key(name): + raise QAPISchemaError(self.parser, "'%s' arg duplicated" % name) + self.section = [self.args, name] + + def _start_meta_section(self, name): + self.end_section() + if name in ("Returns", "Since") and self.has_meta(name): + raise QAPISchemaError(self.parser, "'%s' section duplicated" % name) + self.section = [self.meta, name] + + def _append_section(self, line): + """Add a comment to the current section, or the comment body""" + if self.section: + name = self.section[1] + if not name.startswith("Example"): + # an empty line ends the section, except with Example + if len(self.section) > 2 and len(line) == 0: + self.end_section() + return + # Example is verbatim + line = line.strip() + if len(line) > 0: + self.section.append(line) + else: + self.body.append(line.strip()) + + def end_section(self): + if self.section is not None: + target = self.section[0] + name = self.section[1] + if len(self.section) < 3: + raise QAPISchemaError(self.parser, "Empty doc section") + doc = "\n".join(self.section[2:]) + if isinstance(target, dict): + target[name] = doc + else: + target.append((name, doc)) + self.section = None + + class QAPISchemaParser(object): def __init__(self, fp, previously_included=[], incl_info=None):
@@ -137,9 +234,15 @@ class QAPISchemaParser(object): self.line = 1 self.line_pos = 0 self.exprs = [] + self.docs = [] self.accept() while self.tok is not None: + if self.tok == '#' and self.val.startswith('##'): + doc = self.get_doc() + self.docs.append(doc) + continue + expr_info = {'file': fname, 'line': self.line, 'parent': self.incl_info} expr = self.get_expr(False)
@@ -160,6 +263,7 @@ class QAPISchemaParser(object): raise QAPIExprError(expr_info, "Inclusion loop for %s" % include) inf = inf['parent'] + # skip multiple include of the same file if incl_abs_fname in previously_included: continue
@@ -171,12 +275,40 @@ class QAPISchemaParser(object): exprs_include = QAPISchemaParser(fobj, previously_included, expr_info) self.exprs.extend(exprs_include.exprs) + self.docs.extend(exprs_include.docs) else: expr_elem = {'expr': expr, 'info': expr_info} + if len(self.docs) > 0: + self.docs[-1].expr_elem = expr_elem self.exprs.append(expr_elem) - def accept(self): + def get_doc(self): + if self.val != '##': + raise QAPISchemaError(self, "Doc comment not starting with '##'") + + doc = QAPIDoc(self) + self.accept(False) + while self.tok == '#': + if self.val.startswith('##'): + # ## ends doc + if self.val != '##': + raise QAPISchemaError(self, "non-empty '##' line %s" + % self.val) + self.accept() + doc.end_section() + return doc + else: + doc.append(self.val) + self.accept(False) + + if self.val != '##': + raise QAPISchemaError(self, "Doc comment not finishing with '##'") + + doc.end_section() + return doc + + def accept(self, skip_comment=True): while True: self.tok = self.src[self.cursor] self.pos = self.cursor
@@ -184,7 +316,13 @@ class QAPISchemaParser(object): self.val = None if self.tok == '#': + if self.src[self.cursor] == '#': + # ## starts a doc comment + skip_comment = False self.cursor = self.src.find('\n', self.cursor) + self.val = self.src[self.pos:self.cursor] + if not skip_comment: + return elif self.tok in "{}:,[]": return elif self.tok == "'":
@@ -779,6 +917,41 @@ def check_exprs(exprs): return exprs +def check_docs(docs): + for doc in docs: + expr_elem = doc.expr_elem + if not expr_elem: + continue + + expr = expr_elem['expr'] + for i in ('enum', 'union', 'alternate', 'struct', 'command', 'event'): + if i in expr: + meta = i + break + + info = expr_elem['info'] + name = expr[meta] + if doc.symbol != name: + raise QAPIExprError(info, + "Documentation symbol mismatch '%s' != '%s'" + % (doc.symbol, name)) + if not 'command' in expr and doc.has_meta('Returns'): + raise QAPIExprError(info, "Invalid return documentation") + + doc_args = set(doc.args.keys()) + if meta == 'union': + data = expr.get('base', []) + else: + data = expr.get('data', []) + if isinstance(data, dict): + data = data.keys() + args = set([k.strip('*') for k in data]) + if meta == 'alternate' or \ + (meta == 'union' and not expr.get('discriminator')): + args.add('type') + if not doc_args.issubset(args): + raise QAPIExprError(info, "Members documentation is not a subset of" + " API %r > %r" % (list(doc_args), list(args))) # # Schema compiler frontend
scripts/qapi2texi.py new file +316 -0
316 lines not on this page · raw message
docs/qapi-code-gen.txt +34 -10
62 lines not on this page · raw message
Signature · 1 line
2.10.0
PATCH v4 12/15 texi2pod: learn quotation, deftp and deftypefn
In reply to Marc-André LureauLearn a few more markups used for API documentation.
--- scripts/texi2pod.pl | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
scripts/texi2pod.pl +43 -1
@@ -37,6 +37,7 @@ $inf = ""; $ibase = ""; @ipath = (); $encoding = undef; +@args = (); while ($_ = shift) { if (/^-D(.*)$/) {
@@ -162,7 +163,8 @@ while(<$inf>) { if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) { $skipping = pop @skstack; next; - } elsif ($ended =~ /^(?:example|smallexample|display)$/) { + } elsif ($ended =~ /^(?:example|smallexample|display + |quotation|deftp|deftypefn)$/x) { $shift = ""; $_ = ""; # need a paragraph break } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
@@ -323,6 +325,46 @@ while(<$inf>) { $_ = "\n=item ".join (" : ", @columns)."\n"; }; + /^\@(quotation)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $_ = "\n$2:" + }; + + /^{(.*)}$|^(.*)$/ and $#args > 0 and do { + $kind = $args[0]; + $arguments = $1 // ""; + if ($endw eq "deftypefn") { + $ret = $args[1]; + $fname = "B<$args[2]>"; + $_ = $ret ? "$ret " : ""; + $_ .= "$fname $arguments ($kind)"; + } else { + $_ = "B<$args[1]> ($kind)\n\n$arguments"; + } + @args = (); + }; + + /^\@(deftp)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $arg = $2; + $arg =~ s/{([^}]*)}/$1/g; + $arg =~ s/\@$//; + @args = split (/ /, $arg); + $_ = ""; + }; + + /^\@(deftypefn)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $arg = $2; + $arg =~ s/{([^}]*)}/$1/g; + $arg =~ s/\@$//; + @args = split (/ /, $arg); + $_ = ""; + }; + /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below.
Signature · 1 line
2.10.0
PATCH v4 13/15 qmp-commands: (SQUASHED) move doc to schema
In reply to Marc-André Lureau--- Makefile | 1 - docs/qmp-commands.txt | 3824 ------------------------------------------------- docs/qmp-events.txt | 731 ---------- qapi-schema.json | 1279 ++++++++++++++++- qapi/block-core.json | 679 ++++++++- qapi/block.json | 56 +- qapi/common.json | 32 + qapi/event.json | 240 ++++ qapi/rocker.json | 57 +- qapi/trace.json | 14 + 10 files changed, 2309 insertions(+), 4604 deletions(-) delete mode 100644 docs/qmp-commands.txt delete mode 100644 docs/qmp-events.txt
Makefile +0 -1
@@ -431,7 +431,6 @@ endif install-doc: $(DOCS) $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" - $(INSTALL_DATA) $(SRC_PATH)/docs/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)" ifdef CONFIG_POSIX $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
docs/qmp-commands.txt deleted +0 -3824
2,993 lines not on this page · raw message
docs/qmp-events.txt deleted +0 -731
731 lines not on this page · raw message
qapi-schema.json +1254 -25
1,279 lines not on this page · raw message
qapi/block-core.json +664 -15
679 lines not on this page · raw message
qapi/block.json +52 -4
56 lines not on this page · raw message
qapi/event.json +240 -0
240 lines not on this page · raw message
qapi/rocker.json +53 -4
57 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.10.0
Part of the diff is not shown here. View the raw message.
PATCH v4 14/15 docs: add qemu logo
In reply to Marc-André LureauThe pdf (needed by texi2pdf for vectorized images) was generated thanks to inkscape, from the pc-bios/qemu_logo.svg file. Move the original file in the docs folder too, since it's not being referenced elsewhere.
---
docs/qemu-ga-ref.texi | 4 ++++
docs/qemu-qmp-ref.texi | 4 ++++
docs/qemu_logo.pdf | Bin 0 -> 9117 bytes
{pc-bios => docs}/qemu_logo.svg | 0
4 files changed, 8 insertions(+)
create mode 100644 docs/qemu_logo.pdf
rename {pc-bios => docs}/qemu_logo.svg (100%)docs/qemu-ga-ref.texi +4 -0
@@ -6,6 +6,10 @@ @settitle QEMU Guest Agent Protocol Reference +@iftex +@center @image{docs/qemu_logo} +@end iftex + @copying This is the QEMU Guest Agent Protocol reference manual.
docs/qemu-qmp-ref.texi +4 -0
@@ -6,6 +6,10 @@ @settitle QEMU QMP Reference Manual +@iftex +@center @image{docs/qemu_logo} +@end iftex + @copying This is the QEMU QMP reference manual.
docs/qemu_logo.pdf new file binary +0 -0
docs/qemu_logo.svg renamed from pc-bios/qemu_logo.svg +0 -0
Signature · 1 line
2.10.0
Re: [Qemu-devel] [PATCH v4 14/15] docs: add qemu logo
Quoted 3 lines · Marc-André Lureau
The pdf (needed by texi2pdf for vectorized images) was generated thanks to inkscape, from the pc-bios/qemu_logo.svg file. Move the original file in the docs folder too, since it's not being referenced elsewhere.
I don't think we should be moving the qemu_logo.svg file.
The pc-bios has 3 other logo files qemu_logo_no_text.svg, qemu-icon.bmp and qemu-nsis.ico. Having those three logo files in pc-bios, and the other file in docs/ is unhelpful. IMHO they should all live together, either all in docs/ or all in pc-bios/
I'd probably pick docs/ as its a bit strange to be looking for logos in a bios sub-dir
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Re: [Qemu-devel] [PATCH v4 14/15] docs: add qemu logo
Hi
Quoted 5 lines · Daniel P. Berrange
Quoted 3 lines · Marc-André Lureau
The pdf (needed by texi2pdf for vectorized images) was generated thanks to inkscape, from the pc-bios/qemu_logo.svg file. Move the original file in the docs folder too, since it's not being referenced elsewhere.
Quoted 8 lines
I don't think we should be moving the qemu_logo.svg file.
The pc-bios has 3 other logo files qemu_logo_no_text.svg, qemu-icon.bmp and qemu-nsis.ico. Having those three logo files in pc-bios, and the other file in docs/ is unhelpful. IMHO they should all live together, either all in docs/ or all in pc-bios/
let's keep them in pc-bios for now then. However, the new pdf file can be in docs?
Quoted 4 lines
I'd probably pick docs/ as its a bit strange to be looking for logos in a bios sub-dir
Hmm, we could add docs/ in data_dir[] when running from the build-tree. That should make qemu_find_file() returns files from docs/ too, so we could move the logos.
Signature · 1 line
Marc-André Lureau
PATCH v4 15/15 build-sys: add qapi doc generation targets
In reply to Marc-André LureauGenerate and install the man and html version of QAPI documentation.
Add it also to optional pdf/dvi/info targets.
Also support plain-text targets docs/qemu-ga-ref.txt & docs/qemu-qmp-ref.txt.
--- Makefile | 56 +++++++++++++++++++++++++++++++++++++++++++++++------- .gitignore | 11 ++++++++++- docs/qmp-intro.txt | 3 +-- 3 files changed, 60 insertions(+), 10 deletions(-)
Makefile +49 -7
@@ -91,6 +91,8 @@ HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF) ifdef BUILD_DOCS DOCS=qemu-doc.html qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 +DOCS+=docs/qemu-qmp-ref.html docs/qemu-qmp-ref.7 +DOCS+=docs/qemu-ga-ref.html docs/qemu-ga-ref.7 ifdef CONFIG_VIRTFS DOCS+=fsdev/virtfs-proxy-helper.1 endif
@@ -266,6 +268,7 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated gen-out-type = $(subst .,-,$(suffix $@)) qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py +qapi-py += $(SRC_PATH)/scripts/qapi2texi.py qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
@@ -395,6 +398,11 @@ distclean: clean rm -f qemu-doc.vr rm -f config.log rm -f linux-headers/asm + rm -f qemu-ga-qapi.texi qemu-qapi.texi + rm -f docs/qemu-qmp-ref.7 docs/qemu-ga-ref.7 + rm -f docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt + rm -f docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf + rm -f docs/qemu-qmp-ref.html docs/qemu-ga-ref.html for d in $(TARGET_DIRS); do \ rm -rf $$d || exit 1 ; \ done
@@ -431,9 +439,12 @@ endif install-doc: $(DOCS) $(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) qemu-doc.html "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) docs/qemu-qmp-ref.html "$(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/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" ifneq ($(TOOLS),) $(INSTALL_DATA) qemu-img.1 "$(DESTDIR)$(mandir)/man1" $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
@@ -441,6 +452,8 @@ ifneq ($(TOOLS),) endif ifneq (,$(findstring qemu-ga,$(TOOLS))) $(INSTALL_DATA) qemu-ga.8 "$(DESTDIR)$(mandir)/man8" + $(INSTALL_DATA) docs/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)" + $(INSTALL_DATA) docs/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7" endif endif ifdef CONFIG_VIRTFS
@@ -528,9 +541,9 @@ ui/console-gl.o: $(SRC_PATH)/ui/console-gl.c \ ui/shader/texture-blit-vert.h ui/shader/texture-blit-frag.h # documentation -MAKEINFO=makeinfo +MAKEINFO=makeinfo -D 'VERSION $(VERSION)' MAKEINFOFLAGS=--no-headers --no-split --number-sections -TEXIFLAG=$(if $(V),,--quiet) +TEXIFLAG=$(if $(V),,--quiet) --command='@set VERSION $(VERSION)' %.dvi: %.texi $(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"GEN","$@")
@@ -542,7 +555,11 @@ TEXIFLAG=$(if $(V),,--quiet) $(call quiet-command,$(MAKEINFO) $< -o $@,"GEN","$@") %.pdf: %.texi - $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"GEN","$@") + $(call quiet-command,texi2pdf $(TEXIFLAG) -I . $< -o $@,"GEN","$@") + +%.txt: %.texi + $(call quiet-command,LC_ALL=C $(MAKEINFO) $(MAKEINFOFLAGS) --plaintext $< -o $@,\ + " GEN $@") qemu-options.texi: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
@@ -556,6 +573,12 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@") +qemu-qapi.texi: $(qapi-modules) $(qapi-py) + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN" "$@") + +qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py) + $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@") + qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi $(call quiet-command, \ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
@@ -587,16 +610,35 @@ qemu-ga.8: qemu-ga.texi $(POD2MAN) --section=8 --center=" " --release=" " qemu-ga.pod > $@, \ "GEN","$@") -dvi: qemu-doc.dvi -html: qemu-doc.html -info: qemu-doc.info -pdf: qemu-doc.pdf +docs/qemu-qmp-ref.7: + $(call quiet-command, \ + perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-qmp-ref.pod && \ + $(POD2MAN) --section=7 --center=" " --release=" " qemu-qmp-ref.pod > $@, \ + "GEN","$@") + +docs/qemu-ga-ref.7: + $(call quiet-command, \ + perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-ga-ref.pod && \ + $(POD2MAN) --section=7 --center=" " --release=" " qemu-ga-ref.pod > $@, \ + "GEN","$@") + +dvi: qemu-doc.dvi docs/qemu-qmp-ref.dvi docs/qemu-ga-ref.dvi +html: qemu-doc.html docs/qemu-qmp-ref.html docs/qemu-ga-ref.html +info: qemu-doc.info docs/qemu-qmp-ref.info docs/qemu-ga-ref.info +pdf: qemu-doc.pdf docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor-info.texi +docs/qemu-ga-ref.dvi docs/qemu-ga-ref.html docs/qemu-ga-ref.info docs/qemu-ga-ref.pdf docs/qemu-ga-ref.txt docs/qemu-ga-ref.7: \ +docs/qemu-ga-ref.texi qemu-ga-qapi.texi + +docs/qemu-qmp-ref.dvi docs/qemu-qmp-ref.html docs/qemu-qmp-ref.info docs/qemu-qmp-ref.pdf docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7: \ +docs/qemu-qmp-ref.texi qemu-qapi.texi + + ifdef CONFIG_WIN32 INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
.gitignore +10 -1
@@ -39,7 +39,7 @@ /qmp-introspect.[ch] /qmp-marshal.c /qemu-doc.html -/qemu-doc.info +/qemu-doc.info* /qemu-img /qemu-nbd /qemu-options.def
@@ -109,6 +109,15 @@ /pc-bios/optionrom/kvmvapic.img /pc-bios/s390-ccw/s390-ccw.elf /pc-bios/s390-ccw/s390-ccw.img +/docs/qemu-ga-ref.html +/docs/qemu-ga-ref.txt +/docs/qemu-qmp-ref.html +/docs/qemu-qmp-ref.txt +docs/qemu-ga-ref.info* +docs/qemu-qmp-ref.info* +/qemu-ga-qapi.texi +/qemu-qapi.texi +*.tps .stgit-* cscope.* tags
docs/qmp-intro.txt +1 -2
@@ -16,8 +16,7 @@ QMP is JSON[1] based and features the following: For detailed information on QMP's usage, please, refer to the following files: o qmp-spec.txt QEMU Machine Protocol current specification -o qmp-commands.txt QMP supported commands (auto-generated at build-time) -o qmp-events.txt List of available asynchronous events +o qemu-qmp-ref.html QEMU QMP commands and events (auto-generated at build-time) [1] http://www.json.org
Signature · 1 line
2.10.0