[PATCH v2 00/30] Configurable policy for handling deprecated interfaces

Markus Armbruster armbru at redhat.com
Tue Mar 3 16:34:35 UTC 2020


Based-on: <20200227144531.24309-1-armbru at redhat.com>

This series extends QMP introspection to cover deprecation.
Additionally, new option -compat lets you configure what to do when
deprecated interfaces get used.  This is intended for testing users of
the management interfaces.  It is experimental.

-compat deprecated-input=<in-policy> configures what to do when
deprecated input is received.  Available policies:

* accept: Accept deprecated commands and arguments (default)
* reject: Reject them
* crash: Crash

-compat deprecated-output=<out-policy> configures what to do when
deprecated output is sent.  Available output policies:

* accept: Emit deprecated command results and events (default)
* hide: Suppress them

For now, -compat covers only deprecated syntactic aspects of QMP.  We
may want to extend it to cover semantic aspects, CLI, and experimental
features.

PATCH 01-04: Documentation fixes
PATCH 05-10: Test improvements
PATCH 11-24: Add feature flags to remaining user-defined types and to
      	     struct members
PATCH 25-26: New special feature 'deprecated', visible in
      	     introspection
PATCH 27-30: New -compat to set policy for handling stuff marked with
      	     feature 'deprecated'

Comparison to RFC (24 Oct 2019):
* Cover arguments and results in addition to commands and events
* Half-baked "[RFC PATCH 18/19] qapi: Include a warning in the
  response to a deprecated command" dropped

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 at dusky.pond.sub.org>
    https://lists.nongnu.org/archive/html/qemu-devel/2018-10/msg05828.html

Markus Armbruster (30):
  qemu-doc: Belatedly document QMP command arg & result deprecation
  qapi: Belatedly update doc comment for @wait deprecation
  docs/devel/qapi-code-gen: Clarify allow-oob introspection
  docs/devel/qapi-code-gen: Document 'features' introspection
  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/schema: Clean up around QAPISchemaEntity.connect_doc()
  qapi: Add feature flags to remaining definitions
  qapi: Consistently put @features parameter right after @ifcond
  qapi/introspect: Rename *qlit* to reduce confusion
  qapi/introspect: Factor out _make_tree()
  qapi/schema: Change _make_features() to a take feature list
  qapi/schema: Reorder classes so related ones are together
  qapi/schema: Rename QAPISchemaObjectType{Variant,Variants}
  qapi/schema: Call QAPIDoc.connect_member() in just one place
  qapi: Add feature flags to struct members
  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"
  qapi: Mark deprecated QMP parts with feature 'deprecated'
  qemu-options: New -compat to set policy for deprecated interfaces
  qapi: Implement -compat deprecated-output=hide
  qapi: Implement -compat deprecated-input=reject
  qapi: New -compat deprecated-input=crash

 docs/devel/qapi-code-gen.txt                  |  79 ++-
 qemu-deprecated.texi                          |  38 +-
 tests/qapi-schema/doc-good.texi               |  32 ++
 qapi/block-core.json                          |  69 ++-
 qapi/block.json                               |   9 +-
 qapi/char.json                                |   1 +
 qapi/compat.json                              |  52 ++
 qapi/control.json                             |  11 +-
 qapi/introspect.json                          |  26 +-
 qapi/machine.json                             |  34 +-
 qapi/migration.json                           |  36 +-
 qapi/misc.json                                |  13 +-
 qapi/qapi-schema.json                         |   1 +
 include/qapi/compat-policy.h                  |  20 +
 include/qapi/qmp/dispatch.h                   |   1 +
 include/qapi/qobject-input-visitor.h          |   9 +
 include/qapi/qobject-output-visitor.h         |   9 +
 include/qapi/visitor-impl.h                   |   3 +
 include/qapi/visitor.h                        |   9 +
 qapi/qapi-visit-core.c                        |   9 +
 qapi/qmp-dispatch.c                           | 137 ++---
 qapi/qobject-input-visitor.c                  |  29 ++
 qapi/qobject-output-visitor.c                 |  20 +
 softmmu/vl.c                                  |  17 +
 tests/test-qmp-cmds.c                         | 249 +++++----
 tests/test-qmp-event.c                        | 183 ++-----
 qapi/Makefile.objs                            |   8 +-
 qapi/trace-events                             |   1 +
 qemu-options.hx                               |  23 +
 scripts/qapi/commands.py                      |  20 +-
 scripts/qapi/doc.py                           |  16 +-
 scripts/qapi/events.py                        |  16 +-
 scripts/qapi/expr.py                          |  14 +-
 scripts/qapi/introspect.py                    | 104 ++--
 scripts/qapi/schema.py                        | 488 ++++++++++--------
 scripts/qapi/types.py                         |   8 +-
 scripts/qapi/visit.py                         |  28 +-
 tests/Makefile.include                        |   1 +
 tests/qapi-schema/alternate-base.err          |   2 +-
 tests/qapi-schema/doc-good.json               |  22 +-
 tests/qapi-schema/doc-good.out                |  18 +
 .../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       |  48 +-
 tests/qapi-schema/qapi-schema-test.out        |  46 +-
 tests/qapi-schema/test-qapi.py                |  26 +-
 47 files changed, 1259 insertions(+), 731 deletions(-)
 create mode 100644 qapi/compat.json
 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.1




More information about the libvir-list mailing list