[Qemu-devel] [PATCH for-2.9 22/47] qapi2texi: Explain enum value undocumentedness more clearly

Markus Armbruster posted 47 patches 8 years, 7 months ago
There is a newer version of this series
[Qemu-devel] [PATCH for-2.9 22/47] qapi2texi: Explain enum value undocumentedness more clearly
Posted by Markus Armbruster 8 years, 7 months ago
Instead of not saying anything when we have no documentation, say "Not
documented".

Example change (qemu-qmp-ref.txt):

  -- Enum: GuestPanicAction

      An enumeration of the actions taken when guest OS panic is detected

      Values:
      'pause'
           system pauses
      'poweroff'
+          Not documented

      Since: 2.1 (poweroff since 2.8)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi2texi.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 35e182d..1f01817 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -145,7 +145,10 @@ def texi_members(doc, what, member_func, show_undocumented):
     for section in doc.args.itervalues():
         if not section.content and not show_undocumented:
             continue          # Undocumented TODO require doc and drop
-        desc = str(section)
+        if section.content:
+            desc = str(section)
+        else:
+            desc = 'Not documented'
         items += member_func(section.member) + texi_format(desc) + '\n'
     if not items:
         return ''
-- 
2.7.4


Re: [Qemu-devel] [PATCH for-2.9 22/47] qapi2texi: Explain enum value undocumentedness more clearly
Posted by Eric Blake 8 years, 7 months ago
On 03/13/2017 01:18 AM, Markus Armbruster wrote:
> Instead of not saying anything when we have no documentation, say "Not
> documented".
> 
> Example change (qemu-qmp-ref.txt):
> 
>   -- Enum: GuestPanicAction
> 
>       An enumeration of the actions taken when guest OS panic is detected
> 
>       Values:
>       'pause'
>            system pauses
>       'poweroff'
> +          Not documented
> 
>       Since: 2.1 (poweroff since 2.8)
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  scripts/qapi2texi.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org