qapi: Implement deprecated-output=hide for QMP command results
commit91fa93e516d080d440ead2ad4f88960545bd5b2c
authorMarkus Armbruster <armbru@redhat.com>
Thu, 18 Mar 2021 15:55:11 +0000 (18 16:55 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 19 Mar 2021 14:43:33 +0000 (19 15:43 +0100)
treee37234fb14c3cd0f5822b5e8355205ed0c3ccbd0
parent6dd75472d58d3d199eb5003a8d2ec2334c68f18f
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>
13 files changed:
include/qapi/compat-policy.h
include/qapi/qobject-output-visitor.h
include/qapi/visitor-impl.h
include/qapi/visitor.h
qapi/qapi-visit-core.c
qapi/qmp-dispatch.c
qapi/qobject-output-visitor.c
qapi/trace-events
scripts/qapi/commands.py
scripts/qapi/visit.py
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/unit/test-qmp-cmds.c