mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Add feature flags to enum members
This is quite similar to commit 84ab008687
"qapi: Add feature flags to
struct members", only for enums instead of structs.
Special feature flag 'deprecated' is silently ignored there. This is
okay only because it will be implemented shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211025042405.3762351-3-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
75ecee7262
commit
b6c18755e4
13 changed files with 57 additions and 14 deletions
|
@ -472,7 +472,7 @@ def check_enum(expr: _JSONObject, info: QAPISourceInfo) -> None:
|
|||
for m in members]
|
||||
for member in members:
|
||||
source = "'data' member"
|
||||
check_keys(member, info, source, ['name'], ['if'])
|
||||
check_keys(member, info, source, ['name'], ['if', 'features'])
|
||||
member_name = member['name']
|
||||
check_name_is_str(member_name, info, source)
|
||||
source = "%s '%s'" % (source, member_name)
|
||||
|
@ -483,6 +483,7 @@ def check_enum(expr: _JSONObject, info: QAPISourceInfo) -> None:
|
|||
permit_upper=permissive,
|
||||
permit_underscore=permissive)
|
||||
check_if(member, info, source)
|
||||
check_features(member.get('features'), info)
|
||||
|
||||
|
||||
def check_struct(expr: _JSONObject, info: QAPISourceInfo) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue