Browse Source
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>
pull/81/head
committed by
Markus Armbruster
10 changed files with 114 additions and 18 deletions
@ -1,2 +1,2 @@ |
|||
tests/qapi-schema/double-type.json:2: Unknown key 'command' in struct 'bar' |
|||
Valid keys are 'base', 'data', 'if', 'struct'. |
|||
Valid keys are 'base', 'data', 'features', 'if', 'struct'. |
|||
|
|||
@ -1,2 +1,2 @@ |
|||
tests/qapi-schema/unknown-expr-key.json:2: Unknown keys 'bogus', 'phony' in struct 'bar' |
|||
Valid keys are 'base', 'data', 'if', 'struct'. |
|||
Valid keys are 'base', 'data', 'features', 'if', 'struct'. |
|||
|
|||
Loading…
Reference in new issue