[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-4.0 v7 12/27] qapi: rename allow_dict to allow_i
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH for-4.0 v7 12/27] qapi: rename allow_dict to allow_implicit |
Date: |
Sat, 8 Dec 2018 15:15:51 +0400 |
This makes it a bit clearer what is the intent of the dictionnary for
the check_type() function, since there was some confusion on a
previous iteration of this series.
Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
scripts/qapi/common.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 557b413950..95e55b3f44 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -661,7 +661,7 @@ def check_if(expr, info):
def check_type(info, source, value, allow_array=False,
- allow_dict=False, allow_optional=False,
+ allow_implicit=False, allow_optional=False,
allow_metas=[]):
global all_names
@@ -688,7 +688,7 @@ def check_type(info, source, value, allow_array=False,
(source, all_names[value], value))
return
- if not allow_dict:
+ if not allow_implicit:
raise QAPISemError(info, "%s should be a type name" % source)
if not isinstance(value, OrderedDict):
@@ -718,7 +718,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_implicit=not boxed, allow_optional=True,
allow_metas=args_meta)
returns_meta = ['union', 'struct']
if name in returns_whitelist:
@@ -736,7 +736,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,
+ expr.get('data'), allow_implicit=not boxed, allow_optional=True,
allow_metas=meta)
@@ -764,7 +764,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,
+ base, allow_implicit=True, allow_optional=True,
allow_metas=['struct'])
if not base:
raise QAPISemError(info, "Flat union '%s' must have a base"
@@ -887,7 +887,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_implicit=True, allow_optional=True)
check_type(info, "'base' for struct '%s'" % name, expr.get('base'),
allow_metas=['struct'])
--
2.20.0.rc1
- [Qemu-devel] [PATCH for-4.0 v7 08/27] qapi: add a dictionary form with 'name' key for enum members, (continued)
- [Qemu-devel] [PATCH for-4.0 v7 08/27] qapi: add a dictionary form with 'name' key for enum members, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 07/27] qapi: improve reporting of unknown or missing keys, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 09/27] qapi: add 'if' to enum members, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 10/27] qapi-events: add 'if' condition to implicit event enum, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 11/27] qapi: pass long form enum to make_enum_members, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 12/27] qapi: rename allow_dict to allow_implicit,
Marc-André Lureau <=
- [Qemu-devel] [PATCH for-4.0 v7 13/27] qapi: add a dictionary form for TYPE, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 14/27] qapi: add 'if' to implicit struct members, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 15/27] qapi: add an error in case a discriminator is conditional, Marc-André Lureau, 2018/12/08
- [Qemu-devel] [PATCH for-4.0 v7 16/27] qapi: add 'if' to union members, Marc-André Lureau, 2018/12/08