qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 13/19] qapi: Normalize 'if' in check_exprs(), li


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 13/19] qapi: Normalize 'if' in check_exprs(), like other sugar
Date: Tue, 17 Sep 2019 13:14:52 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/14/19 10:35 AM, Markus Armbruster wrote:
> We normalize shorthand to longhand forms in check_expr(): enumeration
> values with normalize_enum(), feature values with
> normalize_features(), struct members, union branches and alternate
> branches with normalize_members().  If conditions are an exception: we
> normalize them in QAPISchemaEntity.check() and
> QAPISchemaMember.__init(), with listify_cond().  The idea goes back to
> commit 2cbc94376e "qapi: pass 'if' condition into QAPISchemaEntity
> objects", v3.0.0.
> 
> Normalize in check_expr() instead, with new helper normalize_if().
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  scripts/qapi/common.py | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 

Definitely more consistent.


> @@ -904,6 +905,7 @@ def check_union(expr, info):
>          check_known_keys(info, "member '%s' of union '%s'" % (key, name),
>                           value, ['type'], ['if'])
>          check_if(value, info)
> +        normalize_if(value)

Is it worth combining check_if() and normalize_if() into a single helper
function, since they always seem to be paired?

Reviewed-by: Eric Blake <address@hidden>


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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