aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-18 16:55:11 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-19 15:43:33 +0100
commit91fa93e516d080d440ead2ad4f88960545bd5b2c (patch)
treee37234fb14c3cd0f5822b5e8355205ed0c3ccbd0 /tests/qapi-schema
parent6dd75472d58d3d199eb5003a8d2ec2334c68f18f (diff)
qapi: Implement deprecated-output=hide for QMP command results
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP command results. Example: when QEMU is run with -compat deprecated-output=hide, then {"execute": "query-cpus-fast"} yields {"return": [{"thread-id": 9805, "props": {"core-id": 0, "thread-id": 0, "socket-id": 0}, "qom-path": "/machine/unattached/device[0]", "cpu-index": 0, "target": "x86_64"}]} instead of {"return": [{"arch": "x86", "thread-id": 22436, "props": {"core-id": 0, "thread-id": 0, "socket-id": 0}, "qom-path": "/machine/unattached/device[0]", "cpu-index": 0, "target": "x86_64"}]} Note the suppression of deprecated member "arch". Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-4-armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r--tests/qapi-schema/qapi-schema-test.json17
-rw-r--r--tests/qapi-schema/qapi-schema-test.out18
2 files changed, 18 insertions, 17 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index 63f92adf68..48a0adabae 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -299,14 +299,15 @@
'features': [ 'feature1' ] }
{ 'command': 'test-features0',
- 'data': { 'fs0': 'FeatureStruct0',
- 'fs1': 'FeatureStruct1',
- 'fs2': 'FeatureStruct2',
- 'fs3': 'FeatureStruct3',
- 'fs4': 'FeatureStruct4',
- 'cfs1': 'CondFeatureStruct1',
- 'cfs2': 'CondFeatureStruct2',
- 'cfs3': 'CondFeatureStruct3' },
+ 'data': { '*fs0': 'FeatureStruct0',
+ '*fs1': 'FeatureStruct1',
+ '*fs2': 'FeatureStruct2',
+ '*fs3': 'FeatureStruct3',
+ '*fs4': 'FeatureStruct4',
+ '*cfs1': 'CondFeatureStruct1',
+ '*cfs2': 'CondFeatureStruct2',
+ '*cfs3': 'CondFeatureStruct3' },
+ 'returns': 'FeatureStruct1',
'features': [] }
{ 'command': 'test-command-features1',
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index 3b1387d9f1..776d737891 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -409,15 +409,15 @@ alternate FeatureAlternate1
case eins: FeatureStruct1
feature feature1
object q_obj_test-features0-arg
- member fs0: FeatureStruct0 optional=False
- member fs1: FeatureStruct1 optional=False
- member fs2: FeatureStruct2 optional=False
- member fs3: FeatureStruct3 optional=False
- member fs4: FeatureStruct4 optional=False
- member cfs1: CondFeatureStruct1 optional=False
- member cfs2: CondFeatureStruct2 optional=False
- member cfs3: CondFeatureStruct3 optional=False
-command test-features0 q_obj_test-features0-arg -> None
+ member fs0: FeatureStruct0 optional=True
+ member fs1: FeatureStruct1 optional=True
+ member fs2: FeatureStruct2 optional=True
+ member fs3: FeatureStruct3 optional=True
+ member fs4: FeatureStruct4 optional=True
+ member cfs1: CondFeatureStruct1 optional=True
+ member cfs2: CondFeatureStruct2 optional=True
+ member cfs3: CondFeatureStruct3 optional=True
+command test-features0 q_obj_test-features0-arg -> FeatureStruct1
gen=True success_response=True boxed=False oob=False preconfig=False
command test-command-features1 None -> None
gen=True success_response=True boxed=False oob=False preconfig=False