Merge tag 'pull-qapi-2023-05-17-v2' of https://repo.or.cz/qemu/armbru into staging

QAPI patches patches for 2023-05-17

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmRrTcgSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTMycP/3sP6/U4kwOKMGGcB+n2pHJeioQS4xgF
# 94NCW+KpewxApP0XzIC2nDGjUe/rPcUfQmBNUumvYbqHO91tq91wFwkllBv2UR0q
# 6qfRji+e8+9H9hMDeVzzSNjlZZg/tSdIJlhkJDw1u4/3fpjfAmzVx6DO3wepSQ9Q
# m5Af/+uhVZWyUXMZqcKr2Zq8qur6ZFEBNpXpPvT60Tvy2heuQ+vcoE3tl2ZRQbmj
# b/jhtCu+NPjgOHtg9Gr2BPXqQiZBR4vFA7WBsB8wCf2xxULfTwHJvFz/e0vx5fUC
# q0Fsyybf4USo2PRMsRFv2v4dEuVGHb3E1RIJY4NTAxQMqqm4zfOyK0BzOGNDkxCn
# owNP4vKly0e/CfYDY74FHaPId295xyeo6S4Cj5ib9W23AAWUNt6f6vbjlDOLCLON
# c7yXP/aJwhTb2w1t0mLTmsKum3DpLlrudPudTylVlmYfwchkvUGsWYbaxu6H6XWk
# 49Ox/QPVwqG6elXNn3kTY4QqTAppXhE7QcPbioX9WOThVPf6aJCLdZSHEHu4HXkZ
# 4FRu73Z2wcPNB789xOrQoXs24GdKmWXQ6K01KC4v7WNJQBXccec52yGxvktQRZBm
# GL3zYdOOJEL+Y/8JrXTIo26M8HP/4kxV2VqB6KOuaGygMsW9w9jbG+ygLyjqUDQg
# 3APV3hdmVOht
# =6anf
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 22 May 2023 04:11:04 AM PDT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [undefined]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-qapi-2023-05-17-v2' of https://repo.or.cz/qemu/armbru:
  docs/interop: Delete qmp-intro.txt
  docs/interop/qmp-spec: Update error description for parsing errors
  docs/interop: Convert qmp-spec.txt to rST
  qapi: Improve error message for description following section

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson
2023-05-22 15:54:21 -07:00
12 changed files with 224 additions and 260 deletions
+2 -1
View File
@@ -545,7 +545,8 @@ Member 'allow-oob' declares whether the command supports out-of-band
{ 'command': 'migrate_recover',
'data': { 'uri': 'str' }, 'allow-oob': true }
See qmp-spec.txt for out-of-band execution syntax and semantics.
See the :doc:`/interop/qmp-spec` for out-of-band execution syntax
and semantics.
Commands supporting out-of-band execution can still be executed
in-band.
+1
View File
@@ -15,6 +15,7 @@ are useful for making QEMU interoperate with other software.
dbus-display
live-block-operations
pr-helper
qmp-spec
qemu-ga
qemu-ga-ref
qemu-qmp-ref
-88
View File
@@ -1,88 +0,0 @@
QEMU Machine Protocol
=====================
Introduction
------------
The QEMU Machine Protocol (QMP) allows applications to operate a
QEMU instance.
QMP is JSON[1] based and features the following:
- Lightweight, text-based, easy to parse data format
- Asynchronous messages support (ie. events)
- Capabilities Negotiation
For detailed information on QMP's usage, please, refer to the following files:
o qmp-spec.txt QEMU Machine Protocol current specification
o qemu-qmp-ref.html QEMU QMP commands and events (auto-generated at build-time)
[1] https://www.json.org
Usage
-----
You can use the -qmp option to enable QMP. For example, the following
makes QMP available on localhost port 4444:
$ qemu [...] -qmp tcp:localhost:4444,server=on,wait=off
However, for more flexibility and to make use of more options, the -mon
command-line option should be used. For instance, the following example
creates one HMP instance (human monitor) on stdio and one QMP instance
on localhost port 4444:
$ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
-chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
-mon chardev=mon1,mode=control,pretty=on
Please, refer to QEMU's manpage for more information.
Simple Testing
--------------
To manually test QMP one can connect with telnet and issue commands by hand:
$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{
"QMP": {
"version": {
"qemu": {
"micro": 0,
"minor": 0,
"major": 3
},
"package": "v3.0.0"
},
"capabilities": [
"oob"
]
}
}
{ "execute": "qmp_capabilities" }
{
"return": {
}
}
{ "execute": "query-status" }
{
"return": {
"status": "prelaunch",
"singlestep": false,
"running": false
}
}
Please refer to docs/interop/qemu-qmp-ref.* for a complete command
reference, generated from qapi/qapi-schema.json.
QMP wiki page
-------------
https://wiki.qemu.org/QMP
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -54,7 +54,7 @@ class Model:
class Greeting(Model):
"""
Defined in qmp-spec.txt, section 2.2, "Server Greeting".
Defined in qmp-spec.rst, section "Server Greeting".
:param raw: The raw Greeting object.
:raise KeyError: If any required fields are absent.
@@ -82,7 +82,7 @@ class Greeting(Model):
class QMPGreeting(Model):
"""
Defined in qmp-spec.txt, section 2.2, "Server Greeting".
Defined in qmp-spec.rst, section "Server Greeting".
:param raw: The raw QMPGreeting object.
:raise KeyError: If any required fields are absent.
@@ -104,7 +104,7 @@ class QMPGreeting(Model):
class ErrorResponse(Model):
"""
Defined in qmp-spec.txt, section 2.4.2, "error".
Defined in qmp-spec.rst, section "Error".
:param raw: The raw ErrorResponse object.
:raise KeyError: If any required fields are absent.
@@ -126,7 +126,7 @@ class ErrorResponse(Model):
class ErrorInfo(Model):
"""
Defined in qmp-spec.txt, section 2.4.2, "error".
Defined in qmp-spec.rst, section "Error".
:param raw: The raw ErrorInfo object.
:raise KeyError: If any required fields are absent.
+2 -2
View File
@@ -369,7 +369,7 @@ class QMPClient(AsyncProtocol[Message], Events):
# This is very likely a server parsing error.
# It doesn't inherently belong to any pending execution.
# Instead of performing clever recovery, just terminate.
# See "NOTE" in qmp-spec.txt, section 2.4.2
# See "NOTE" in qmp-spec.rst, section "Error".
raise ServerParseError(
("Server sent an error response without an ID, "
"but there are no ID-less executions pending. "
@@ -377,7 +377,7 @@ class QMPClient(AsyncProtocol[Message], Events):
msg
)
# qmp-spec.txt, section 2.4:
# qmp-spec.rst, section "Commands Responses":
# 'Clients should drop all the responses
# that have an unknown "id" field.'
self.logger.log(
+2 -2
View File
@@ -27,7 +27,7 @@
# Notes: 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 qemu
# docs/interop/qmp-spec.txt)
# docs/interop/qmp-spec.rst)
#
# The QMP client needs to explicitly enable QMP capabilities,
# otherwise all the QMP capabilities will be turned off by
@@ -46,7 +46,7 @@
# connection, used for agreeing on particular QMP extension behaviors.
#
# @oob: QMP ability to support out-of-band requests. (Please refer to
# qmp-spec.txt for more information on OOB)
# qmp-spec.rst for more information on OOB)
#
# Since: 2.12
##
+2 -1
View File
@@ -29,7 +29,8 @@
# -> data issued by the Client
# <- Server data response
#
# Please, refer to the QMP specification (docs/interop/qmp-spec.txt)
# Please refer to the
# :doc:`QEMU Machine Protocol Specification </interop/qmp-spec>`
# for detailed information on the Server command and response formats.
##
+22 -6
View File
@@ -4170,26 +4170,42 @@ DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
QEMU_ARCH_ALL)
SRST
``-qmp dev``
Like -monitor but opens in 'control' mode.
Like ``-monitor`` but opens in 'control' mode. For example, to make
QMP available on localhost port 4444::
-qmp tcp:localhost:4444,server=on,wait=off
Not all options are configurable via this syntax; for maximum
flexibility use the ``-mon`` option and an accompanying ``-chardev``.
ERST
DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
"-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
QEMU_ARCH_ALL)
SRST
``-qmp-pretty dev``
Like -qmp but uses pretty JSON formatting.
Like ``-qmp`` but uses pretty JSON formatting.
ERST
DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
"-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
SRST
``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
Setup monitor on chardev name. ``mode=control`` configures
a QMP monitor (a JSON RPC-style protocol) and it is not the
same as HMP, the human monitor that has a "(qemu)" prompt.
``pretty`` is only valid when ``mode=control``,
Set up a monitor connected to the chardev ``name``.
QEMU supports two monitors: the Human Monitor Protocol
(HMP; for human interaction), and the QEMU Monitor Protocol
(QMP; a JSON RPC-style protocol).
The default is HMP; ``mode=control`` selects QMP instead.
``pretty`` is only valid when ``mode=control``,
turning on JSON pretty printing to ease
human reading and debugging.
For example::
-chardev socket,id=mon1,host=localhost,port=4444,server=on,wait=off \
-mon chardev=mon1,mode=control,pretty=on
enables the QMP monitor on localhost port 4444 with pretty-printing.
ERST
DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
+1 -1
View File
@@ -139,7 +139,7 @@ static const uint8_t json_lexer[][256] = {
* bytes '\xFE', '\xFF'. Structural characters and line
* endings are promising resynchronization points. Clients
* may use the others to force the JSON parser into known-good
* state; see docs/interop/qmp-spec.txt.
* state; see docs/interop/qmp-spec.rst.
*/
[0 ... 0x1F] = IN_START | LOOKAHEAD,
[0x20 ... 0xFD] = IN_RECOVERY,
+2 -2
View File
@@ -675,8 +675,8 @@ class QAPIDoc:
match = self._match_at_name_colon(line)
if match:
raise QAPIParseError(self._parser,
"'@%s:' can't follow '%s' section"
% (match.group(1), self.sections[0].name))
"description of '@%s:' follows a section"
% match.group(1))
match = self._match_section_tag(line)
if match:
line = line[match.end():]
@@ -1 +1 @@
doc-interleaved-section.json:15:1: '@foobar:' can't follow 'Note' section
doc-interleaved-section.json:15:1: description of '@foobar:' follows a section