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 41/47] qapi: Factor add_name() calls out


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-2.9 41/47] qapi: Factor add_name() calls out of the meta conditional
Date: Tue, 14 Mar 2017 19:39:42 -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:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  scripts/qapi.py | 24 +++++++++---------------
>  1 file changed, 9 insertions(+), 15 deletions(-)
> 

Reviewed-by: Eric Blake <address@hidden>

>  def add_enum(definition, info):
>      global enum_types
> -    name = definition['enum']
> -    add_name(name, info, 'enum', 'data' not in definition)

Here, we were passing a potential True for the 'implicit' parameter...


> +        name = expr[meta]
> +        add_name(name, info, meta)

...here, we always pass False, but that's okay (an explicit enum always
has 'data'),

>          if doc and doc.symbol != name:
>              raise QAPISemError(info, "Definition of '%s' follows 
> documentation"
>                                 " for '%s'" % (name, doc.symbol))
> @@ -974,6 +967,7 @@ def check_exprs(exprs):
>          else:
>              continue
>          add_enum({ 'enum': name }, expr_elem['info'])
> +        add_name(name, info, 'enum', implicit=True)

...and here is the only place that was getting implicit=True.  Took me a
while to see it, but the refactoring is sane.

-- 
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]