qapi: Fix to reject optional members with reserved names
commitdbfe3c7c289c6b95a920b4e2a178e583c17c62a8
authorMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 09:40:04 +0000 (23 10:40 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 23 Mar 2021 21:29:37 +0000 (23 22:29 +0100)
tree6be7de08ba3bbd26d6fec0524ee6fc0933d2ae09
parent73c40b07c6fffcb2725f4c9d3f361967e39aef97
qapi: Fix to reject optional members with reserved names

check_type() fails to reject optional members with reserved names,
because it neglects to strip off the leading '*'.  Fix that.

The stripping in check_name_str() is now useless.  Drop.

Also drop the "no leading '*'" assertion, because valid_name.match()
ensures it can't fail.

Fixes: 9fb081e0b98409556d023c7193eeb68947cd1211
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210323094025.3569441-8-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
scripts/qapi/expr.py
tests/qapi-schema/reserved-member-u.err
tests/qapi-schema/reserved-member-u.json
tests/qapi-schema/reserved-member-u.out