mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
qapi: Fix errors for non-string, non-dictionary members
Fixes the errors demonstrated by the previous commit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
10689e36eb
commit
c6b71e5ae7
7 changed files with 9 additions and 10 deletions
|
@ -462,13 +462,15 @@ def check_type(expr_info, source, value, allow_array = False,
|
|||
% (source, all_names[value], orig_value))
|
||||
return
|
||||
|
||||
# value is a dictionary, check that each member is okay
|
||||
if not isinstance(value, OrderedDict):
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a dictionary" % source)
|
||||
if not allow_dict:
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a type name" % source)
|
||||
|
||||
if not isinstance(value, OrderedDict):
|
||||
raise QAPIExprError(expr_info,
|
||||
"%s should be a dictionary or type name" % source)
|
||||
|
||||
# value is a dictionary, check that each member is okay
|
||||
for (key, arg) in value.items():
|
||||
check_name(expr_info, "Member of %s" % source, key,
|
||||
allow_optional=allow_optional)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue