aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-09-27 15:46:18 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-09-28 17:17:18 +0200
commit638c4af9310ee1f8bf878da99c87c0af26417679 (patch)
tree8e41720eaf316d230ea9e4cf799fbeaf33151827 /qapi
parent7be6c511943613c60b3e5b640e09bdc916be3b65 (diff)
downloadqemu-638c4af9310ee1f8bf878da99c87c0af26417679.zip
qemu-638c4af9310ee1f8bf878da99c87c0af26417679.tar.gz
qemu-638c4af9310ee1f8bf878da99c87c0af26417679.tar.bz2
qapi: Clean up member name case checking
QAPISchemaMember.check_clash() checks for member names that map to the same c_name(). Takes care of rejecting duplicate names. It also checks a naming rule: no uppercase in member names. That's a rather odd place to do it. Enforcing naming rules is check_name_str()'s job. qapi-code-gen.txt specifies the name case rule applies to the name as it appears in the schema. check_clash() checks c_name(name) instead. No difference, as c_name() leaves alone case, but unclean. Move the name case check into check_name_str(), less the c_name(). New argument @permit_upper suppresses it. Pass permit_upper=True for definitions (which are not members), and when the member's owner is whitelisted with pragma name-case-whitelist. Bonus: name-case-whitelist now applies to a union's inline base, too. Update qapi/qapi-schema.json pragma to whitelist union CpuInfo instead of CpuInfo's implicit base type's name q_obj_CpuInfo-base. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190927134639.4284-6-armbru@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/qapi-schema.json2
1 files changed, 1 insertions, 1 deletions
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 920b03b..9751b11 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -71,7 +71,7 @@
'QapiErrorClass', # all members, visible through errors
'UuidInfo', # UUID, visible through query-uuid
'X86CPURegister32', # all members, visible indirectly through qom-get
- 'q_obj_CpuInfo-base' # CPU, visible through query-cpu
+ 'CpuInfo' # CPU, visible through query-cpu
] } }
# Documentation generated with qapi-gen.py is in source order, with