mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Add feature flags to remaining definitions
In v4.1.0, we added feature flags just to struct types (commit 6a8c0b5102^..f3ed93d545), to satisfy an immediate need (commitc9d4070991
"file-posix: Add dynamic-auto-read-only QAPI feature"). In v4.2.0, we added them to commands (commit23394b4c39
"qapi: Add feature flags to commands") to satisfy another immediate need (commit d76744e65e "qapi: Allow introspecting fix for savevm's cooperation with blockdev"). Add them to the remaining definitions: enumeration types, union types, alternate types, and events. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200317115459.31821-13-armbru@redhat.com>
This commit is contained in:
parent
e4405b3069
commit
013b4efc9b
17 changed files with 242 additions and 121 deletions
|
@ -219,7 +219,6 @@ def check_struct(expr, info):
|
|||
|
||||
check_type(members, info, "'data'", allow_dict=name)
|
||||
check_type(expr.get('base'), info, "'base'")
|
||||
check_features(expr.get('features'), info)
|
||||
|
||||
|
||||
def check_union(expr, info):
|
||||
|
@ -267,7 +266,6 @@ def check_command(expr, info):
|
|||
raise QAPISemError(info, "'boxed': true requires 'data'")
|
||||
check_type(args, info, "'data'", allow_dict=not boxed)
|
||||
check_type(rets, info, "'returns'", allow_array=True)
|
||||
check_features(expr.get('features'), info)
|
||||
|
||||
|
||||
def check_event(expr, info):
|
||||
|
@ -319,18 +317,18 @@ def check_exprs(exprs):
|
|||
|
||||
if meta == 'enum':
|
||||
check_keys(expr, info, meta,
|
||||
['enum', 'data'], ['if', 'prefix'])
|
||||
['enum', 'data'], ['if', 'features', 'prefix'])
|
||||
check_enum(expr, info)
|
||||
elif meta == 'union':
|
||||
check_keys(expr, info, meta,
|
||||
['union', 'data'],
|
||||
['base', 'discriminator', 'if'])
|
||||
['base', 'discriminator', 'if', 'features'])
|
||||
normalize_members(expr.get('base'))
|
||||
normalize_members(expr['data'])
|
||||
check_union(expr, info)
|
||||
elif meta == 'alternate':
|
||||
check_keys(expr, info, meta,
|
||||
['alternate', 'data'], ['if'])
|
||||
['alternate', 'data'], ['if', 'features'])
|
||||
normalize_members(expr['data'])
|
||||
check_alternate(expr, info)
|
||||
elif meta == 'struct':
|
||||
|
@ -348,13 +346,14 @@ def check_exprs(exprs):
|
|||
check_command(expr, info)
|
||||
elif meta == 'event':
|
||||
check_keys(expr, info, meta,
|
||||
['event'], ['data', 'boxed', 'if'])
|
||||
['event'], ['data', 'boxed', 'if', 'features'])
|
||||
normalize_members(expr.get('data'))
|
||||
check_event(expr, info)
|
||||
else:
|
||||
assert False, 'unexpected meta type'
|
||||
|
||||
check_if(expr, info, meta)
|
||||
check_features(expr.get('features'), info)
|
||||
check_flags(expr, info)
|
||||
|
||||
return exprs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue