qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 09/32] qapi: check_type() parameter allow_op


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [RFC PATCH 09/32] qapi: check_type() parameter allow_optional is now unused, drop
Date: Wed, 4 Oct 2017 12:55:17 +0200

On Mon, Oct 2, 2017 at 5:25 PM, Markus Armbruster <address@hidden> wrote:
> Signed-off-by: Markus Armbruster <address@hidden>

Reviewed-by: Marc-André Lureau <address@hidden>


> ---
>  scripts/qapi.py | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 208010c241..8f9c5666bd 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -629,8 +629,7 @@ def add_name(name, info, meta, implicit=False):
>      all_names[name] = meta
>
>
> -def check_type(info, source, value, allow_array=False,
> -               allow_dict=False, allow_optional=False,
> +def check_type(info, source, value, allow_array=False, allow_dict=False,
>                 allow_metas=[]):
>      global all_names
>
> @@ -686,7 +685,7 @@ def check_command(expr, info):
>      if boxed:
>          args_meta += ['union', 'alternate']
>      check_type(info, "'data' for command '%s'" % name,
> -               expr.get('data'), allow_dict=not boxed, allow_optional=True,
> +               expr.get('data'), allow_dict=not boxed,
>                 allow_metas=args_meta)
>      returns_meta = ['union', 'struct']
>      if name in returns_whitelist:
> @@ -704,8 +703,7 @@ def check_event(expr, info):
>      if boxed:
>          meta += ['union', 'alternate']
>      check_type(info, "'data' for event '%s'" % name,
> -               expr.get('data'), allow_dict=not boxed, allow_optional=True,
> -               allow_metas=meta)
> +               expr.get('data'), allow_dict=not boxed, allow_metas=meta)
>
>
>  def check_union(expr, info):
> @@ -728,8 +726,7 @@ def check_union(expr, info):
>      else:
>          # The object must have a string or dictionary 'base'.
>          check_type(info, "'base' for union '%s'" % name,
> -                   base, allow_dict=True, allow_optional=True,
> -                   allow_metas=['struct'])
> +                   base, allow_dict=True, allow_metas=['struct'])
>          if not base:
>              raise QAPISemError(info, "Flat union '%s' must have a base"
>                                 % name)
> @@ -843,7 +840,7 @@ def check_struct(expr, info):
>      members = expr['data']
>
>      check_type(info, "'data' for struct '%s'" % name, members,
> -               allow_dict=True, allow_optional=True)
> +               allow_dict=True)
>      check_type(info, "'base' for struct '%s'" % name, expr.get('base'),
>                 allow_metas=['struct'])
>
> --
> 2.13.6
>
>



-- 
Marc-André Lureau



reply via email to

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