aboutsummaryrefslogtreecommitdiff
path: root/docs/sphinx/qapi_domain.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2025-03-10 23:42:11 -0400
committerMarkus Armbruster <armbru@redhat.com>2025-03-11 10:07:03 +0100
commit758bbdcd1212bb0b7369fea249114ad02d4b7fd0 (patch)
treeed202696c2147ac81e06981df47ba063e70bbd5a /docs/sphinx/qapi_domain.py
parent8799c3641a869bb04387ccc4922a66bbd5fcd67e (diff)
downloadqemu-758bbdcd1212bb0b7369fea249114ad02d4b7fd0.zip
qemu-758bbdcd1212bb0b7369fea249114ad02d4b7fd0.tar.gz
qemu-758bbdcd1212bb0b7369fea249114ad02d4b7fd0.tar.bz2
docs/qapi-domain: add qapi:command directive
This commit adds a stubbed version of QAPICommand that utilizes the QAPIObject class, the qapi:command directive, the :qapi:cmd: cross-reference role, and the "command" object type in the QAPI object registry. They don't do anything *particularly* interesting yet, but that will come in forthcoming commits. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-14-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'docs/sphinx/qapi_domain.py')
-rw-r--r--docs/sphinx/qapi_domain.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/sphinx/qapi_domain.py b/docs/sphinx/qapi_domain.py
index 3109c0c..547040f 100644
--- a/docs/sphinx/qapi_domain.py
+++ b/docs/sphinx/qapi_domain.py
@@ -258,6 +258,12 @@ class QAPIObject(QAPIDescription):
return sig
+class QAPICommand(QAPIObject):
+ """Description of a QAPI Command."""
+
+ # Nothing unique for now! Changed in later commits O:-)
+
+
class QAPIModule(QAPIDescription):
"""
Directive to mark description of a new module.
@@ -379,12 +385,14 @@ class QAPIDomain(Domain):
# for each object type.
object_types: Dict[str, ObjType] = {
"module": ObjType(_("module"), "mod", "any"),
+ "command": ObjType(_("command"), "cmd", "any"),
}
# Each of these provides a rST directive,
# e.g. .. qapi:module:: block-core
directives = {
"module": QAPIModule,
+ "command": QAPICommand,
}
# These are all cross-reference roles; e.g.
@@ -392,6 +400,7 @@ class QAPIDomain(Domain):
# the object_types table values above.
roles = {
"mod": QAPIXRefRole(),
+ "cmd": QAPIXRefRole(),
"any": QAPIXRefRole(), # reference *any* type of QAPI object.
}