qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] qapi: Remove wrapper struct for simple unions


From: Kevin Wolf
Subject: Re: [PATCH 3/6] qapi: Remove wrapper struct for simple unions
Date: Fri, 23 Oct 2020 16:06:17 +0200

Am 23.10.2020 um 14:49 hat Markus Armbruster geschrieben:
> In addition to that, I get
> 
>     /usr/bin/sphinx-build-3 -Dversion=5.1.50 -Drelease= 
> -Ddepfile=docs/interop.d -Ddepfile_stamp=docs/interop.stamp -b html -d 
> /work/armbru/qemu/bld-x86/docs/interop.p /work/armbru/qemu/docs/interop 
> /work/armbru/qemu/bld-x86/docs/interop
>     Running Sphinx v2.2.2
>     building [mo]: targets for 0 po files that are out of date
>     building [html]: targets for 12 source files that are out of date
>     updating environment: [new config] 12 added, 0 changed, 0 removed
>     reading sources... [  8%] bitmaps
>     reading sources... [ 16%] dbus
>     reading sources... [ 25%] dbus-vmstate
>     reading sources... [ 33%] index
>     reading sources... [ 41%] live-block-operations
>     reading sources... [ 50%] pr-helper
>     reading sources... [ 58%] qemu-ga
>     reading sources... [ 66%] qemu-ga-ref
>     reading sources... [ 75%] qemu-qmp-ref
> 
>     Exception occurred:
>       File "/work/armbru/qemu/docs/sphinx/qapidoc.py", line 187, in 
> _nodes_for_members
>         assert not v.type.base and not v.type.variants
>     AttributeError: 'QAPISchemaBuiltinType' object has no attribute 'base'

FWIW, when I install sphinx on F33 (sphinx-build 3.2.1), master doesn't
even build for me, so I uninstalled it again for now...

But the fix is the following, I'll include it in v2.

Kevin

diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index e03abcbb95..75f6721e29 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -183,12 +183,14 @@ class QAPISchemaGenRSTVisitor(QAPISchemaVisitor):
 
         if variants:
             for v in variants.variants:
-                if v.type.is_implicit():
-                    assert not v.type.base and not v.type.variants
-                    for m in v.type.local_members:
-                        term = self._nodes_for_one_member(m)
-                        term.extend(self._nodes_for_variant_when(variants, v))
-                        dlnode += self._make_dlitem(term, None)
+                if v.wrapped:
+                    term = [nodes.literal('', 'data'),
+                            nodes.Text(': '),
+                            nodes.literal('', v.type.doc_type())]
+                    term.extend(self._nodes_for_variant_when(variants, v))
+                    dlnode += self._make_dlitem(term, None)
+                elif v.type.is_implicit():
+                    assert v.type.name == 'q_empty'
                 else:
                     term = [nodes.Text('The members of '),
                             nodes.literal('', v.type.doc_type())]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]