This series is RFC because it's incomplete, and the warning idea in
PATCH 18 is half-baked. I'm soliciting feed back from the management
application crowd: is this going into a useful direction?
The series adresses only deprecated commands and events. Good enough
to demonstrate the ideas, I think. A complete solution should
additionally cover arguments and return values. Feels feasible to me.
New option -compat deprecated-input=<in-policy>,deprecated-output=out-policy
configures the policy. Available input policies:
* accept: Accept deprecated commands with a warning (default)
* reject: Reject deprecated commands
* crash: Crash on deprecated command
Available output policies:
* accept: Emit deprecated events (default)
* hide: Suppress deprecated events
See also last item of
Subject: Minutes of KVM Forum BoF on deprecating stuff
Date: Fri, 26 Oct 2018 16:03:51 +0200
Message-ID: <87mur0ls8o.fsf(a)dusky.pond.sub.org>
https://lists.nongnu.org/archive/html/qemu-devel/2018-10/msg05828.html
Markus Armbruster (19):
tests/test-qmp-cmds: Factor out qmp_dispatch() test helpers
tests/test-qmp-cmds: Check responses more thoroughly
tests/test-qmp-cmds: Simplify test data setup
tests/test-qmp-event: Simplify test data setup
tests/test-qmp-event: Use qobject_is_equal()
tests/test-qmp-event: Check event is actually emitted
qapi: Add feature flags to remaining definitions
qapi: Consistently put @features parameter right after @ifcond
qapi: Inline do_qmp_dispatch() into qmp_dispatch()
qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP
qapi: Simplify how qmp_dispatch() gets the request ID
qapi: Replace qmp_dispatch()'s TODO comment by an explanation
qapi: New special feature flag "deprecated"
qemu-options: New -compat to set policy for "funny" interfaces
qapi: Mark deprecated QMP commands with feature 'deprecated'
qapi: Implement -compat deprecated-input=reject for commands
qapi: Implement -compat deprecated-input=crash for commands
qapi: Include a warning in the response to a deprecated command
qapi: Implement -compat deprecated-output=hide for events
docs/devel/qapi-code-gen.txt | 21 +-
tests/qapi-schema/doc-good.texi | 32 ++-
qapi/common.json | 48 ++++
qapi/introspect.json | 28 ++-
qapi/machine.json | 24 +-
qapi/migration.json | 36 ++-
qapi/misc.json | 25 +-
include/qapi/compat-policy.h | 20 ++
include/qapi/qmp/dispatch.h | 1 +
qapi/qmp-dispatch.c | 140 +++++++-----
tests/test-qmp-cmds.c | 216 +++++++++++-------
tests/test-qmp-event.c | 181 ++++-----------
vl.c | 17 ++
qemu-options.hx | 24 ++
scripts/qapi/commands.py | 16 +-
scripts/qapi/doc.py | 16 +-
scripts/qapi/events.py | 16 +-
scripts/qapi/expr.py | 11 +-
scripts/qapi/introspect.py | 41 ++--
scripts/qapi/schema.py | 138 ++++++-----
scripts/qapi/types.py | 8 +-
scripts/qapi/visit.py | 8 +-
tests/Makefile.include | 1 +
tests/qapi-schema/alternate-base.err | 2 +-
tests/qapi-schema/doc-good.json | 18 +-
tests/qapi-schema/doc-good.out | 20 +-
.../qapi-schema/features-deprecated-type.err | 2 +
.../qapi-schema/features-deprecated-type.json | 3 +
.../qapi-schema/features-deprecated-type.out | 0
tests/qapi-schema/qapi-schema-test.json | 31 ++-
tests/qapi-schema/qapi-schema-test.out | 29 ++-
tests/qapi-schema/test-qapi.py | 19 +-
32 files changed, 731 insertions(+), 461 deletions(-)
create mode 100644 include/qapi/compat-policy.h
create mode 100644 tests/qapi-schema/features-deprecated-type.err
create mode 100644 tests/qapi-schema/features-deprecated-type.json
create mode 100644 tests/qapi-schema/features-deprecated-type.out
--
2.21.0