]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qapi: Implement boxed event argument documentation
authorMarkus Armbruster <armbru@redhat.com>
Thu, 24 Oct 2019 11:02:24 +0000 (13:02 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 29 Oct 2019 06:35:16 +0000 (07:35 +0100)
Generate a reference "Arguments: the members of ...", just like we do
for commands since commit c2dd311cb7 "qapi2texi: Implement boxed
argument documentation".

No change to generated QMP documentation; we don't yet use boxed
events outside tests/.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-7-armbru@redhat.com>

scripts/qapi/doc.py
tests/qapi-schema/doc-good.json
tests/qapi-schema/doc-good.out
tests/qapi-schema/doc-good.texi

index 6d5726cf6e3ae8e72e5d832162ed3026ffc94065..f2462c9877084bdd7a226fceb07f33273d565099 100644 (file)
@@ -266,9 +266,17 @@ class QAPISchemaGenDocVisitor(QAPISchemaVisitor):
 
     def visit_event(self, name, info, ifcond, arg_type, boxed):
         doc = self.cur_doc
+        if boxed:
+            body = texi_body(doc)
+            body += ('\n@b{Arguments:} the members of @code{%s}\n'
+                     % arg_type.name)
+            body += texi_features(doc)
+            body += texi_sections(doc, ifcond)
+        else:
+            body = texi_entity(doc, 'Arguments', ifcond)
         self._gen.add(MSG_FMT(type='Event',
                               name=doc.symbol,
-                              body=texi_entity(doc, 'Arguments', ifcond)))
+                              body=body))
 
     def symbol(self, doc, entity):
         if self._gen._body:
index df50a877e3608c6b81ee0778f4e520464f04cc0a..d992e713d97e083023116fcd4f1a3aa7f863c90a 100644 (file)
 
 ##
 # @EVT-BOXED:
-# BUG: generated doc misses arguments
 ##
 { 'event': 'EVT-BOXED',  'boxed': true,
   'data': 'Object' }
index 8cc29fce50b0c2d06d1784150dd57bc5489ab695..4c9406a464d84a5ae71826cd9a85f5e929ba6899 100644 (file)
@@ -196,4 +196,4 @@ another feature
 <- out
 doc symbol=EVT-BOXED
     body=
-BUG: generated doc misses arguments
+
index 98aa78e1fbdb11fef6242798a32e50199f366e72..d4b15dabf03e6c450bad0ff991f05517209ab268 100644 (file)
@@ -279,7 +279,9 @@ another feature
 
 @deftypefn Event {} EVT-BOXED
 
-BUG: generated doc misses arguments
+
+
+@b{Arguments:} the members of @code{Object}
 
 @end deftypefn