qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.9 26/47] qapi2texi: Generate reference to


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-2.9 26/47] qapi2texi: Generate reference to base type members
Date: Tue, 14 Mar 2017 14:29:01 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 03/13/2017 01:18 AM, Markus Armbruster wrote:
> The generated documentation doesn't mention object type members
> inherited from a base type.  Fix that.
> 
> Example change (qemu-qmp-ref.txt):
> 
>   -- Struct: VncServerInfo
> 
>       The network connection information for server
> 
>       Members:
>       'auth' (optional)
>          authentication method used for the plain (non-websocket) VNC
>          server
> +     The members of 'VncBasicInfo'
> 

Again, will be more useful later in the series when you add hyperlinking.

>       Since: 2.1
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  scripts/qapi2texi.py | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

> diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
> index 993b652..7083d0c 100755
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi2texi.py
> @@ -143,7 +143,7 @@ def texi_member(member):
>          ' (optional)' if member.optional else '')
>  
>  
> -def texi_members(doc, what, member_func):
> +def texi_members(doc, what, base, member_func):
>      """Format the table of members"""
>      items = ''
>      for section in doc.args.itervalues():
> @@ -152,6 +152,8 @@ def texi_members(doc, what, member_func):
>          else:
>              desc = 'Not documented'
>          items += member_func(section.member) + texi_format(desc) + '\n'
> +    if base:
> +        items += '@item The members of @code{%s}\n' % base.doc_type()

Will this still work for implicit bases?

>  
> @@ -205,11 +207,13 @@ class QAPISchemaGenDocVisitor(qapi.QAPISchemaVisitor):
>              typ = 'Flat Union'
>          else:
>              typ = 'Simple Union'
> +        if base and base.is_implicit():
> +            base = None

Hmm - you just ignore those, such as the anonymous base in CpuInfo.  On
the other hand, CpuInfo documents its base fields explicitly.  Are we at
risk of double-documenting a base member, both explicitly and via its
named base type?

At any rate, this patch is an incremental improvement, so:
Reviewed-by: Eric Blake <address@hidden>

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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