qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 24/49] qapi: add a dictionary form with 'type


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v3 24/49] qapi: add a dictionary form with 'type' key for members
Date: Wed, 20 Jun 2018 13:13:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

No review, just a short note.

Marc-André Lureau <address@hidden> writes:

> Wherever a struct/union/alternate/command/event member with NAME: TYPE
> form is accepted, desugar it to a NAME: { 'type': TYPE } form.
>
> This will allow to add new member details, such as 'if' in the
> following patch to introduce conditionals, or 'default' for default
> values etc.
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
[...]
> diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
> index 9eb2b0cc37..3f46ed5530 100644
> --- a/scripts/qapi/common.py
> +++ b/scripts/qapi/common.py
[...]
> @@ -952,6 +967,10 @@ def check_exprs(exprs):
>          info = expr_elem['info']
>          if 'enum' in expr:
>              normalize_enum(expr, info)
> +        elif 'union' in expr:
> +            normalize_members(expr, 'base')
> +        if {'union', 'alternate', 'struct', 'command', 'event'} & set(expr):
> +            normalize_members(expr, 'data')

You've since changed this to

  +        if set(['union', 'alternate', 'struct', 'command', 'event']) & 
set(expr):
  +            normalize_members(expr, 'data')

in your git branch.

>  
>      # Learn the types and check for valid expression keys
>      for expr_elem in exprs:
[...]



reply via email to

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