aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-10-25 06:24:02 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-10-27 17:18:55 +0200
commitb6c18755e41f7b40aad4c2c8188fb1719535699d (patch)
tree461b80ebb2bd36703020099c09172d5c1fb544bf /docs
parent75ecee7262548d21a9e20c12f0b3b12f8a51d5c6 (diff)
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 'docs')
-rw-r--r--docs/devel/qapi-code-gen.rst16
1 files changed, 11 insertions, 5 deletions
diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst
index d267889d2c..4071c9074a 100644
--- a/docs/devel/qapi-code-gen.rst
+++ b/docs/devel/qapi-code-gen.rst
@@ -200,7 +200,9 @@ Syntax::
'*if': COND,
'*features': FEATURES }
ENUM-VALUE = STRING
- | { 'name': STRING, '*if': COND }
+ | { 'name': STRING,
+ '*if': COND,
+ '*features': FEATURES }
Member 'enum' names the enum type.
@@ -706,8 +708,10 @@ QEMU shows a certain behaviour.
Special features
~~~~~~~~~~~~~~~~
-Feature "deprecated" marks a command, event, or struct member as
-deprecated. It is not supported elsewhere so far.
+Feature "deprecated" marks a command, event, enum value, or struct
+member as deprecated. It is not supported elsewhere so far.
+Interfaces so marked may be withdrawn in future releases in accordance
+with QEMU's deprecation policy.
Naming rules and reserved names
@@ -1157,7 +1161,8 @@ and "variants".
"members" is a JSON array describing the object's common members, if
any. Each element is a JSON object with members "name" (the member's
-name), "type" (the name of its type), and optionally "default". The
+name), "type" (the name of its type), "features" (a JSON array of
+feature strings), and "default". The latter two are optional. The
member is optional if "default" is present. Currently, "default" can
only have value null. Other values are reserved for future
extensions. The "members" array is in no particular order; clients
@@ -1234,7 +1239,8 @@ The SchemaInfo for an enumeration type has meta-type "enum" and
variant member "members".
"members" is a JSON array describing the enumeration values. Each
-element is a JSON object with member "name" (the member's name). The
+element is a JSON object with member "name" (the member's name), and
+optionally "features" (a JSON array of feature strings). The
"members" array is in no particular order; clients must search the
entire array when learning whether a particular value is supported.