summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-09-27 15:46:23 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-09-28 17:17:19 +0200
commit6ba1ba7f0e54f100af8d4e28e9bc9978c971c0e0 (patch)
treea9c6b0074cd251a23fedf895f99d77e3eca00e72 /scripts
parentd7bc17c602f128bb358376e6976b3b5dee1ad732 (diff)
downloadqemu-6ba1ba7f0e54f100af8d4e28e9bc9978c971c0e0.zip
qapi: Use check_name_str() where it suffices
Replace check_name() by check_name_str() where the name is known to be a string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-11-armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/common.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index 6f35cd131e..d0d997f31c 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -816,8 +816,8 @@ def check_type(value, info, source,
# value is a dictionary, check that each member is okay
for (key, arg) in value.items():
- check_name(key, info, "member of %s" % source,
- allow_optional=True, permit_upper=permit_upper)
+ check_name_str(key, info, "member of %s" % source,
+ allow_optional=True, permit_upper=permit_upper)
if c_name(key, False) == 'u' or c_name(key, False).startswith('has_'):
raise QAPISemError(
info, "member of %s uses reserved name '%s'" % (source, key))
@@ -920,8 +920,7 @@ def check_union(expr, info):
raise QAPISemError(info, "union '%s' has no branches" % name)
for (key, value) in members.items():
- check_name(key, info, "member of union '%s'" % name)
-
+ check_name_str(key, info, "member of union '%s'" % name)
check_known_keys(value, info,
"member '%s' of union '%s'" % (key, name),
['type'], ['if'])
@@ -951,7 +950,7 @@ def check_alternate(expr, info):
raise QAPISemError(info,
"alternate '%s' cannot have empty 'data'" % name)
for (key, value) in members.items():
- check_name(key, info, "member of alternate '%s'" % name)
+ check_name_str(key, info, "member of alternate '%s'" % name)
check_known_keys(value, info,
"member '%s' of alternate '%s'" % (key, name),
['type'], ['if'])