diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-10-25 06:24:02 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-10-27 17:18:55 +0200 |
commit | b6c18755e41f7b40aad4c2c8188fb1719535699d (patch) | |
tree | 461b80ebb2bd36703020099c09172d5c1fb544bf /scripts/qapi/introspect.py | |
parent | 75ecee7262548d21a9e20c12f0b3b12f8a51d5c6 (diff) | |
download | qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.zip qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.tar.gz qemu-b6c18755e41f7b40aad4c2c8188fb1719535699d.tar.bz2 |
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/introspect.py')
-rw-r--r-- | scripts/qapi/introspect.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 6334546..67c7d89 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -275,12 +275,13 @@ const QLitObject %(c_name)s = %(c_string)s; obj['features'] = self._gen_features(features) self._trees.append(Annotated(obj, ifcond, comment)) - @staticmethod - def _gen_enum_member(member: QAPISchemaEnumMember + def _gen_enum_member(self, member: QAPISchemaEnumMember ) -> Annotated[SchemaInfoEnumMember]: obj: SchemaInfoEnumMember = { 'name': member.name, } + if member.features: + obj['features'] = self._gen_features(member.features) return Annotated(obj, member.ifcond) def _gen_object_member(self, member: QAPISchemaObjectTypeMember |