]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
docs/qapi-domain: add :namespace: override option
authorJohn Snow <jsnow@redhat.com>
Thu, 13 Mar 2025 04:43:05 +0000 (00:43 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 14 Mar 2025 06:31:57 +0000 (07:31 +0100)
Akin to the :module: override option, the :namespace: options allows you
to forcibly override the contextual namespace associatied with a
definition.

We don't necessarily actually need this, but I felt compelled to stick
close to how the Python domain works that offers context overrides.

As of this commit, it is possible to add e.g. ":namespace: QMP" to any
QAPI directive to forcibly associate that definition with a given
namespace.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250313044312.189276-5-jsnow@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
docs/devel/qapi-domain.rst
docs/sphinx/qapi_domain.py

index 1475870ca6c27ca0839720150b6dc16dfc2130aa..51b283277e1443c9d39d3b0fa9e4d4b189203521 100644 (file)
@@ -466,6 +466,8 @@ QAPI standard options
 
 All QAPI directives -- *except* for module -- support these common options.
 
+* ``:namespace: name`` -- This option allows you to override the
+  namespace association of a given definition.
 * ``:module: modname`` -- Borrowed from the Python domain, this option allows
   you to override the module association of a given definition.
 * ``:since: x.y`` -- Allows the documenting of "Since" information, which is
index 48a082d489ae6fb7bc17c3626e4005479c05af6f..6485c43206386b73ef87fcfce9dca9702729ecee 100644 (file)
@@ -294,8 +294,9 @@ class QAPIObject(QAPIDescription):
     )
     option_spec.update(
         {
-            # Borrowed from the Python domain:
-            "module": directives.unchanged,  # Override contextual module name
+            # Context overrides:
+            "namespace": directives.unchanged,
+            "module": directives.unchanged,
             # These are QAPI originals:
             "since": directives.unchanged,
             "ifcond": directives.unchanged,