aboutsummaryrefslogtreecommitdiff
path: root/qapi/introspect.json
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-06-06 17:37:57 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-06-12 18:34:26 +0200
commit6a8c0b51025314cdb1a8b4be24d45e690f1217dd (patch)
treec4fb5778169c61051d941b3f9d0deb8d6d608ee2 /qapi/introspect.json
parent2ea8e96da2974512f27fab03758b301dff180b6d (diff)
qapi: Add feature flags to struct types
Sometimes, the behaviour of QEMU changes without a change in the QMP syntax (usually by allowing values or operations that previously resulted in an error). QMP clients may still need to know whether they can rely on the changed behavior. Let's add feature flags to the QAPI schema language, so that we can make such changes visible with schema introspection. An example for a schema definition using feature flags looks like this: { 'struct': 'TestType', 'data': { 'number': 'int' }, 'features': [ 'allow-negative-numbers' ] } Introspection information then looks like this: { "name": "TestType", "meta-type": "object", "members": [ { "name": "number", "type": "int" } ], "features": [ "allow-negative-numbers" ] } This patch implements feature flags only for struct types. We'll implement them more widely as needed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20190606153803.5278-2-armbru@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi/introspect.json')
-rw-r--r--qapi/introspect.json6
1 files changed, 5 insertions, 1 deletions
diff --git a/qapi/introspect.json b/qapi/introspect.json
index 3d22166b2b..1843c1cb17 100644
--- a/qapi/introspect.json
+++ b/qapi/introspect.json
@@ -174,6 +174,9 @@
# and may even differ from the order of the values of the
# enum type of the @tag.
#
+# @features: names of features associated with the type, in no particular
+# order. (since: 4.1)
+#
# Values of this type are JSON object on the wire.
#
# Since: 2.5
@@ -181,7 +184,8 @@
{ 'struct': 'SchemaInfoObject',
'data': { 'members': [ 'SchemaInfoObjectMember' ],
'*tag': 'str',
- '*variants': [ 'SchemaInfoObjectVariant' ] } }
+ '*variants': [ 'SchemaInfoObjectVariant' ],
+ '*features': [ 'str' ] } }
##
# @SchemaInfoObjectMember: