diff options
author | John Snow <jsnow@redhat.com> | 2025-07-11 01:10:42 -0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2025-07-14 12:02:58 +0200 |
commit | 2e51072ae5c0275733be748fbee3ce59df6d6261 (patch) | |
tree | 121a848b8c6f4c6288fa67ad5a957fcd25941cc0 | |
parent | 92227370eb3d844528e6d7bc2fb42525d8245eaf (diff) | |
download | qemu-2e51072ae5c0275733be748fbee3ce59df6d6261.zip qemu-2e51072ae5c0275733be748fbee3ce59df6d6261.tar.gz qemu-2e51072ae5c0275733be748fbee3ce59df6d6261.tar.bz2 |
docs/qapi-domain: add return-nodesc
This form is used to annotate a return type without an accompanying
description, for when there is no "Returns:" information in the source
doc, but we have a return type we want to generate a cross-reference to.
The syntax is:
:return-nodesc: TypeName
It's primarily necessary because Sphinx always expects both a type and a
description for the prior form and will format it accordingly. To have a
reasonable rendering when the body is missing, we need to use a
different info field list entirely.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250711051045.51110-2-jsnow@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
[Long line wrapped]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
-rw-r--r-- | docs/devel/qapi-domain.rst | 31 | ||||
-rw-r--r-- | docs/sphinx/qapi_domain.py | 8 |
2 files changed, 39 insertions, 0 deletions
diff --git a/docs/devel/qapi-domain.rst b/docs/devel/qapi-domain.rst index 1123872..b71890f 100644 --- a/docs/devel/qapi-domain.rst +++ b/docs/devel/qapi-domain.rst @@ -242,6 +242,37 @@ Example:: } +``:return-nodesc:`` +------------------- + +Document the return type of a QAPI command, without an accompanying +description. + +:availability: This field list is only available in the body of the + Command directive. +:syntax: ``:return-nodesc: type`` +:type: `sphinx.util.docfields.Field + <https://pydoc.dev/sphinx/latest/sphinx.util.docfields.Field.html?private=1>`_ + + +Example:: + + .. qapi:command:: query-replay + :since: 5.2 + + Retrieve the record/replay information. It includes current + instruction count which may be used for ``replay-break`` and + ``replay-seek`` commands. + + :return-nodesc: ReplayInfo + + .. qmp-example:: + + -> { "execute": "query-replay" } + <- { "return": { + "mode": "play", "filename": "log.rr", "icount": 220414 } + } + ``:value:`` ----------- diff --git a/docs/sphinx/qapi_domain.py b/docs/sphinx/qapi_domain.py index ebc46a7..f561dc4 100644 --- a/docs/sphinx/qapi_domain.py +++ b/docs/sphinx/qapi_domain.py @@ -532,6 +532,14 @@ class QAPICommand(QAPIObject): names=("return",), can_collapse=True, ), + # :return-nodesc: TypeName + CompatField( + "returnvalue", + label=_("Return"), + names=("return-nodesc",), + bodyrolename="type", + has_arg=False, + ), ] ) |