Skip to content

Commit cd9e186

Browse files
committed
Merge tag 'pull-qapi-2025-04-08' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2025-04-08 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmf0y3ESHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTSXgP/iSQ0F/8GFqdX9+k5WJ7Sd+IzxJPkPM2 # UnjhT2viBP7pC2/Ok2NFfUnigXBCNFyLX/TNcWAK1RMfxuj9GWSJqAMxrMlTPgp0 # Oef3RdE4gQ0h/8/hA8VwdAHza9ItAdZDmpOYO1JGq1B+FVb0P8HPtwKYFhf+gMGa # YcEuwD6DkilbPGnSEBmN7t78V7yp/pQ6SL/38O97aVyEmrVGtqAD1KiV2Va7JjVF # GoOYivejTyqJeaY9dvPxxfWi/3HAPFN+q2giNZe+dOPuyYQ6oeryIyJM+sM1/8xG # PTJayBnV7f8tXPvWrJVyiMC8vWropZ3ExY2/YJ2WNmhJIvrhj9pVxiCUgD18Akgf # McvDjExVilIMNQCBnRLdrXDFWcc8Y+/GlVMB386a0X9OS+be3Am6b34MDG3UMjvy # 6SL4fyOyfBkBNxrsJnngcMZgUf/VcwdLBGMGfpS9kjsXEQtlV9SfB3TbBnRMfh+t # DWSLnEFh5AaYOnmGcC6+JG9sttM93+Boyq/tqi8n+38TDQswOB8q/XtSdHYd0f6L # dEfD0kRmaOCOrWjakeRKvDJ0IvZbWl/iBmYDfSbe6cFIeMC82cR8sud7WYhZLk+D # /Q0hMp7u7954ASxdM+P6iuPE17586edtWkk442uH/vKKkwYoPFyBN6+LSNAJEREX # 4SHZhLuHCNNN # =X7db # -----END PGP SIGNATURE----- # gpg: Signature made Tue 08 Apr 2025 03:08:33 EDT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "[email protected]" # gpg: Good signature from "Markus Armbruster <[email protected]>" [full] # gpg: aka "Markus Armbruster <[email protected]>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-qapi-2025-04-08' of https://repo.or.cz/qemu/armbru: qga/qapi-schema: Add a proper introduction storage-daemon/qapi/qapi-schema: Add a proper introduction qapi/qapi-schema: Address the introduction's bit rot qapi/qapi-schema: Update introduction for example notation docs/sphinx/qmp_lexer: Highlight elisions like comments, not prompts docs/sphinx/qmp_lexer: Generalize elision syntax docs/devel/qapi-code-gen: Improve the part on qmp-example directive docs/interop: Sanitize QMP reference manuals TOC docs/interop: Delete "QEMU Guest Agent Protocol Reference" TOC qapi/rocker: Tidy up query-rocker-of-dpa-flows example docs/devel/qapi-code-gen: Tidy up whitespace Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents e5ddbb4 + 8d41a7d commit cd9e186

File tree

12 files changed

+83
-60
lines changed

12 files changed

+83
-60
lines changed

docs/devel/qapi-code-gen.rst

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ Names beginning with ``x-`` used to signify "experimental". This
763763
convention has been replaced by special feature "unstable".
764764

765765
Pragmas ``command-name-exceptions`` and ``member-name-exceptions`` let
766-
you violate naming rules. Use for new code is strongly discouraged. See
767-
`Pragma directives`_ for details.
766+
you violate naming rules. Use for new code is strongly discouraged.
767+
See `Pragma directives`_ for details.
768768

769769

770770
Downstream extensions
@@ -1013,7 +1013,7 @@ like this::
10131013
document the success and the error response, respectively.
10141014

10151015
"Errors" sections should be formatted as an rST list, each entry
1016-
detailing a relevant error condition. For example::
1016+
detailing a relevant error condition. For example::
10171017

10181018
# Errors:
10191019
# - If @device does not exist, DeviceNotFound
@@ -1026,31 +1026,28 @@ definition.
10261026
QMP). In other sections, the text is formatted, and rST markup can be
10271027
used.
10281028

1029-
QMP Examples can be added by using the ``.. qmp-example::``
1030-
directive. In its simplest form, this can be used to contain a single
1031-
QMP code block which accepts standard JSON syntax with additional server
1032-
directionality indicators (``->`` and ``<-``), and elisions (``...``).
1029+
QMP Examples can be added by using the ``.. qmp-example::`` directive.
1030+
In its simplest form, this can be used to contain a single QMP code
1031+
block which accepts standard JSON syntax with additional server
1032+
directionality indicators (``->`` and ``<-``), and elisions. An
1033+
elision is commonly ``...``, but it can also be or a pair of ``...``
1034+
with text in between.
10331035

10341036
Optionally, a plaintext title may be provided by using the ``:title:``
1035-
directive option. If the title is omitted, the example title will
1037+
directive option. If the title is omitted, the example title will
10361038
default to "Example:".
10371039

10381040
A simple QMP example::
10391041

10401042
# .. qmp-example::
1041-
# :title: Using query-block
10421043
#
1043-
# -> { "execute": "query-block" }
1044-
# <- { ... }
1044+
# -> { "execute": "query-name" }
1045+
# <- { "return": { "name": "Fred" } }
10451046

1046-
More complex or multi-step examples where exposition is needed before or
1047-
between QMP code blocks can be created by using the ``:annotated:``
1048-
directive option. When using this option, nested QMP code blocks must be
1049-
entered explicitly with rST's ``::`` syntax.
1050-
1051-
Highlighting in non-QMP languages can be accomplished by using the
1052-
``.. code-block:: lang`` directive, and non-highlighted text can be
1053-
achieved by omitting the language argument.
1047+
More complex or multi-step examples where exposition is needed before
1048+
or between QMP code blocks can be created by using the ``:annotated:``
1049+
directive option. When using this option, nested QMP code blocks must
1050+
be entered explicitly with rST's ``::`` syntax.
10541051

10551052
For example::
10561053

@@ -1061,11 +1058,21 @@ For example::
10611058
# This is a more complex example that can use
10621059
# ``arbitrary rST syntax`` in its exposition::
10631060
#
1064-
# -> { "execute": "query-block" }
1065-
# <- { ... }
1061+
# -> { "execute": "query-block" }
1062+
# <- { "return": [
1063+
# {
1064+
# "device": "ide0-hd0",
1065+
# ...
1066+
# }
1067+
# ... more ...
1068+
# ] }
10661069
#
10671070
# Above, lengthy output has been omitted for brevity.
10681071

1072+
Highlighting in non-QMP languages can be accomplished by using the
1073+
``.. code-block:: lang`` directive, and non-highlighted text can be
1074+
achieved by omitting the language argument.
1075+
10691076

10701077
Examples of complete definition documentation::
10711078

@@ -1466,7 +1473,9 @@ As an example, we'll use the following schema, which describes a
14661473
single complex user-defined type, along with command which takes a
14671474
list of that type as a parameter, and returns a single element of that
14681475
type. The user is responsible for writing the implementation of
1469-
qmp_my_command(); everything else is produced by the generator. ::
1476+
qmp_my_command(); everything else is produced by the generator.
1477+
1478+
::
14701479

14711480
$ cat example-schema.json
14721481
{ 'struct': 'UserDefOne',

docs/interop/qemu-ga-ref.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
QEMU Guest Agent Protocol Reference
22
===================================
33

4-
.. contents::
5-
:depth: 3
6-
74
.. qapi-doc:: qga/qapi-schema.json
85
:transmogrify:
96
:namespace: QGA

docs/interop/qemu-qmp-ref.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ QEMU QMP Reference Manual
44
=========================
55

66
.. contents::
7-
:depth: 3
7+
:local:
88

99
.. qapi-doc:: qapi/qapi-schema.json
1010
:transmogrify:

docs/interop/qemu-storage-daemon-qmp-ref.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QEMU Storage Daemon QMP Reference Manual
22
========================================
33

44
.. contents::
5-
:depth: 3
5+
:local:
66

77
.. qapi-doc:: storage-daemon/qapi/qapi-schema.json
88
:transmogrify:

docs/sphinx/qmp_lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class QMPExampleMarkersLexer(RegexLexer):
2424
'root': [
2525
(r'-> ', token.Generic.Prompt),
2626
(r'<- ', token.Generic.Prompt),
27-
(r' ?\.{3} ?', token.Generic.Prompt),
27+
(r'\.{3}( .* \.{3})?', token.Comment.Multiline),
2828
]
2929
}
3030

qapi/qapi-schema.json

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,24 @@
33
##
44
# = Introduction
55
#
6-
# This document describes all commands currently supported by QMP.
6+
# This manual describes the commands and events supported by the QEMU
7+
# Monitor Protocol (QMP).
78
#
89
# For locating a particular item, please see the `qapi-qmp-index`.
910
#
10-
# Most of the time their usage is exactly the same as in the user
11-
# Monitor, this means that any other document which also describe
12-
# commands (the manpage, QEMU's manual, etc) can and should be
13-
# consulted.
11+
# The following notation is used in examples:
1412
#
15-
# QMP has two types of commands: regular and query commands. Regular
16-
# commands usually change the Virtual Machine's state someway, while
17-
# query commands just return information. The sections below are
18-
# divided accordingly.
13+
# .. qmp-example::
1914
#
20-
# It's important to observe that all communication examples are
21-
# formatted in a reader-friendly way, so that they're easier to
22-
# understand. However, in real protocol usage, they're emitted as a
23-
# single line.
15+
# -> ... text sent by client (commands) ...
16+
# <- ... text sent by server (command responses and events) ...
2417
#
25-
# Also, the following notation is used to denote data flow:
26-
#
27-
# Example:
28-
#
29-
# ::
30-
#
31-
# -> data issued by the Client
32-
# <- Server data response
18+
# Example text is formatted for readability. However, in real
19+
# protocol usage, its commonly emitted as a single line.
3320
#
3421
# Please refer to the
3522
# :doc:`QEMU Machine Protocol Specification </interop/qmp-spec>`
36-
# for detailed information on the Server command and response formats.
23+
# for the general format of commands, responses, and events.
3724
##
3825

3926
{ 'include': 'pragma.json' }

qapi/rocker.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
# "action": {"goto-tbl": 10},
255255
# "mask": {"in-pport": 4294901760}
256256
# },
257-
# {...},
257+
# ...
258258
# ]}
259259
##
260260
{ 'command': 'query-rocker-of-dpa-flows',

qga/qapi-schema.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@
22
# vim: filetype=python
33

44
##
5-
# = QEMU guest agent protocol commands and structs
5+
# This manual describes the commands supported by the QEMU Guest
6+
# Agent Protocol.
67
#
7-
# For a concise listing of all commands, events, and types in the QEMU
8-
# guest agent, please consult the `qapi-qga-index`.
8+
# For locating a particular item, please see the `qapi-qga-index`.
9+
#
10+
# The following notation is used in examples:
11+
#
12+
# .. qmp-example::
13+
#
14+
# -> ... text sent by client (commands) ...
15+
# <- ... text sent by server (command responses and events) ...
16+
#
17+
# Example text is formatted for readability. However, in real
18+
# protocol usage, its commonly emitted as a single line.
19+
#
20+
# Please refer to the
21+
# :doc:`QEMU Machine Protocol Specification </interop/qmp-spec>`
22+
# for the general format of commands, responses, and events.
923
##
1024

1125
{ 'pragma': { 'doc-required': true } }

storage-daemon/qapi/qapi-schema.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,26 @@
1414
# storage daemon.
1515

1616
##
17-
# = QEMU storage daemon protocol commands and structs
17+
# = Introduction
1818
#
19-
# For a concise listing of all commands, events, and types in the QEMU
20-
# storage daemon, please consult the `qapi-qsd-index`.
19+
# This manual describes the commands and events supported by the QEMU
20+
# storage daemon QMP.
21+
#
22+
# For locating a particular item, please see the `qapi-qsd-index`.
23+
#
24+
# The following notation is used in examples:
25+
#
26+
# .. qmp-example::
27+
#
28+
# -> ... text sent by client (commands) ...
29+
# <- ... text sent by server (command responses and events) ...
30+
#
31+
# Example text is formatted for readability. However, in real
32+
# protocol usage, its commonly emitted as a single line.
33+
#
34+
# Please refer to the
35+
# :doc:`QEMU Machine Protocol Specification </interop/qmp-spec>`
36+
# for the general format of commands, responses, and events.
2137
##
2238

2339

tests/qapi-schema/doc-good.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
#
213213
# -> "this example"
214214
#
215-
# <- "has no title"
215+
# <- ... has no title ...
216216
##
217217
{ 'command': 'cmd-boxed', 'boxed': true,
218218
'data': 'Object',

0 commit comments

Comments
 (0)