2020-01-29 13:22:37 +03:00
|
|
|
# -*- Mode: Python -*-
|
2020-07-29 21:50:24 +03:00
|
|
|
# vim: filetype=python
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
##
|
|
|
|
# = QMP monitor control
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# @qmp_capabilities:
|
|
|
|
#
|
|
|
|
# Enable QMP capabilities.
|
|
|
|
#
|
|
|
|
# @enable: An optional list of QMPCapability values to enable. The
|
2023-04-28 13:54:29 +03:00
|
|
|
# client must not enable any capability that is not mentioned in
|
|
|
|
# the QMP greeting message. If the field is not provided, it
|
|
|
|
# means no QMP capabilities will be enabled. (since 2.12)
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-17 05:13:08 +03:00
|
|
|
# .. qmp-example::
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "qmp_capabilities",
|
|
|
|
# "arguments": { "enable": [ "oob" ] } }
|
|
|
|
# <- { "return": {} }
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-29 09:52:20 +03:00
|
|
|
# .. note:: This command is valid exactly when first connecting: it
|
|
|
|
# must be issued before any other command will be accepted, and
|
|
|
|
# will fail once the monitor is accepting other commands. (see
|
|
|
|
# :doc:`/interop/qmp-spec`)
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-29 09:52:20 +03:00
|
|
|
# .. note:: The QMP client needs to explicitly enable QMP
|
|
|
|
# capabilities, otherwise all the QMP capabilities will be turned
|
|
|
|
# off by default.
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
|
|
|
# Since: 0.13
|
|
|
|
##
|
|
|
|
{ 'command': 'qmp_capabilities',
|
|
|
|
'data': { '*enable': [ 'QMPCapability' ] },
|
|
|
|
'allow-preconfig': true }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @QMPCapability:
|
|
|
|
#
|
|
|
|
# Enumeration of capabilities to be advertised during initial client
|
|
|
|
# connection, used for agreeing on particular QMP extension behaviors.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @oob: QMP ability to support out-of-band requests. (Please refer to
|
2023-05-15 19:22:43 +03:00
|
|
|
# qmp-spec.rst for more information on OOB)
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
|
|
|
# Since: 2.12
|
|
|
|
##
|
|
|
|
{ 'enum': 'QMPCapability',
|
|
|
|
'data': [ 'oob' ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @VersionTriple:
|
|
|
|
#
|
|
|
|
# A three-part version number.
|
|
|
|
#
|
|
|
|
# @major: The major version number.
|
|
|
|
#
|
|
|
|
# @minor: The minor version number.
|
|
|
|
#
|
|
|
|
# @micro: The micro version number.
|
|
|
|
#
|
|
|
|
# Since: 2.4
|
|
|
|
##
|
|
|
|
{ 'struct': 'VersionTriple',
|
|
|
|
'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @VersionInfo:
|
|
|
|
#
|
|
|
|
# A description of QEMU's version.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @qemu: The version of QEMU. By current convention, a micro version
|
|
|
|
# of 50 signifies a development branch. A micro version greater
|
|
|
|
# than or equal to 90 signifies a release candidate for the next
|
|
|
|
# minor version. A micro version of less than 50 signifies a
|
|
|
|
# stable release.
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @package: QEMU will always set this field to an empty string.
|
|
|
|
# Downstream versions of QEMU should set this to a non-empty
|
|
|
|
# string. The exact format depends on the downstream however it
|
|
|
|
# highly recommended that a unique name is used.
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2020-01-29 13:22:37 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'VersionInfo',
|
|
|
|
'data': {'qemu': 'VersionTriple', 'package': 'str'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-version:
|
|
|
|
#
|
|
|
|
# Returns the current version of QEMU.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# Returns: A @VersionInfo object describing the current version of
|
|
|
|
# QEMU.
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-17 05:13:08 +03:00
|
|
|
# .. qmp-example::
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "query-version" }
|
|
|
|
# <- {
|
|
|
|
# "return":{
|
|
|
|
# "qemu":{
|
|
|
|
# "major":0,
|
|
|
|
# "minor":11,
|
|
|
|
# "micro":5
|
|
|
|
# },
|
|
|
|
# "package":""
|
|
|
|
# }
|
|
|
|
# }
|
2020-01-29 13:22:37 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-version', 'returns': 'VersionInfo',
|
|
|
|
'allow-preconfig': true }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @CommandInfo:
|
|
|
|
#
|
|
|
|
# Information about a QMP command
|
|
|
|
#
|
|
|
|
# @name: The command name
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2020-01-29 13:22:37 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-commands:
|
|
|
|
#
|
|
|
|
# Return a list of supported QMP commands by this server
|
|
|
|
#
|
|
|
|
# Returns: A list of @CommandInfo for all supported commands
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-17 05:13:08 +03:00
|
|
|
# .. qmp-example::
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "query-commands" }
|
|
|
|
# <- {
|
|
|
|
# "return":[
|
|
|
|
# {
|
|
|
|
# "name":"query-balloon"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name":"system_powerdown"
|
2024-06-27 01:21:14 +03:00
|
|
|
# },
|
|
|
|
# ...
|
2024-02-16 17:58:34 +03:00
|
|
|
# ]
|
|
|
|
# }
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
qapi: convert "Note" sections to plain rST
We do not need a dedicated section for notes. By eliminating a specially
parsed section, these notes can be treated as normal rST paragraphs in
the new QMP reference manual, and can be placed and styled much more
flexibly.
Convert all existing "Note" and "Notes" sections to pure rST. As part of
the conversion, capitalize the first letter of each sentence and add
trailing punctuation where appropriate to ensure notes look sensible and
consistent in rendered HTML documentation. Markup is also re-aligned to
the de-facto standard of 3 spaces for directives.
Update docs/devel/qapi-code-gen.rst to reflect the new paradigm, and
update the QAPI parser to prohibit "Note" sections while suggesting a
new syntax. The exact formatting to use is a matter of taste, but a good
candidate is simply:
.. note:: lorem ipsum ...
... dolor sit amet ...
... consectetur adipiscing elit ...
... but there are other choices, too. The Sphinx readthedocs theme
offers theming for the following forms (capitalization unimportant); all
are adorned with a (!) symbol () in the title bar for rendered HTML
docs.
See
https://sphinx-rtd-theme.readthedocs.io/en/stable/demo/demo.html#admonitions
for examples of each directive/admonition in use.
These are rendered in orange:
.. Attention:: ...
.. Caution:: ...
.. WARNING:: ...
These are rendered in red:
.. DANGER:: ...
.. Error:: ...
These are rendered in green:
.. Hint:: ...
.. Important:: ...
.. Tip:: ...
These are rendered in blue:
.. Note:: ...
.. admonition:: custom title
admonition body text
This patch uses ".. note::" almost everywhere, with just two "caution"
directives. Several instances of "Notes:" have been converted to
merely ".. note::", or multiple ".. note::" where appropriate.
".. admonition:: notes" is used in a few places where we had an
ordered list of multiple notes that would not make sense as
standalone/separate admonitions. Two "Note:" following "Example:"
have been turned into ordinary paragraphs within the example.
NOTE: Because qapidoc.py does not attempt to preserve source ordering of
sections, the conversion of Notes from a "tagged section" to an
"untagged section" means that rendering order for some notes *may
change* as a result of this patch. The forthcoming qapidoc.py rewrite
strictly preserves source ordering in the rendered documentation, so
this issue will be rectified in the new generator.
Signed-off-by: John Snow <jsnow@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com> [for block*.json]
Message-ID: <20240626222128.406106-11-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message clarified slightly, period added to one more note]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2024-06-27 01:21:16 +03:00
|
|
|
# This example has been shortened as the real response is too long.
|
2020-01-29 13:22:37 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-commands', 'returns': ['CommandInfo'],
|
|
|
|
'allow-preconfig': true }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @quit:
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# This command will cause the QEMU process to exit gracefully. While
|
|
|
|
# every attempt is made to send the QMP response before terminating,
|
|
|
|
# this is not guaranteed. When using this interface, a premature EOF
|
|
|
|
# would not be unexpected.
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-07-17 05:13:08 +03:00
|
|
|
# .. qmp-example::
|
2020-01-29 13:22:37 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "quit" }
|
|
|
|
# <- { "return": {} }
|
2020-01-29 13:22:37 +03:00
|
|
|
##
|
2020-10-27 13:56:32 +03:00
|
|
|
{ 'command': 'quit',
|
|
|
|
'allow-preconfig': true }
|
2020-02-24 17:30:04 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @MonitorMode:
|
|
|
|
#
|
|
|
|
# An enumeration of monitor modes.
|
|
|
|
#
|
|
|
|
# @readline: HMP monitor (human-oriented command line interface)
|
|
|
|
#
|
|
|
|
# @control: QMP monitor (JSON-based machine interface)
|
|
|
|
#
|
|
|
|
# Since: 5.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'MonitorMode', 'data': [ 'readline', 'control' ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @MonitorOptions:
|
|
|
|
#
|
|
|
|
# Options to be used for adding a new monitor.
|
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @id: Name of the monitor
|
2020-02-24 17:30:04 +03:00
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @mode: Selects the monitor mode (default: readline in the system
|
2023-04-28 13:54:29 +03:00
|
|
|
# emulator, control in qemu-storage-daemon)
|
2020-02-24 17:30:04 +03:00
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @pretty: Enables pretty printing (QMP only)
|
2020-02-24 17:30:04 +03:00
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @chardev: Name of a character device to expose the monitor on
|
2020-02-24 17:30:04 +03:00
|
|
|
#
|
|
|
|
# Since: 5.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'MonitorOptions',
|
|
|
|
'data': {
|
|
|
|
'*id': 'str',
|
|
|
|
'*mode': 'MonitorMode',
|
|
|
|
'*pretty': 'bool',
|
|
|
|
'chardev': 'str'
|
|
|
|
} }
|