diff options
author | Markus Armbruster | 2021-10-25 06:24:02 +0200 |
---|---|---|
committer | Markus Armbruster | 2021-10-27 17:18:55 +0200 |
commit | b6c18755e41f7b40aad4c2c8188fb1719535699d (patch) | |
tree | 461b80ebb2bd36703020099c09172d5c1fb544bf /scripts/qapi/expr.py | |
parent | qapi: Enable enum member introspection to show more than name (diff) | |
download | qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.tar.gz qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.tar.xz qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.zip |
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>
Diffstat (limited to 'scripts/qapi/expr.py')
-rw-r--r-- | scripts/qapi/expr.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 819ea6ad97..3cb389e875 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -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: |