Skip to content

qapi: Add feature flags to enum members

Markus Armbruster qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 10 repliesIn review
  2. v35 patches 1 replySuperseded
  3. v25 patches 11 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC5 patches13 repliesSuperseded

Changes in v4 from the cover letter

* PATCH 1: Deprecate SchemaInfoEnum member @values.
* PATCH 2: Doc tweak

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5qapi: Enable enum member introspection to show more than namedocs/about/deprecated.rst docs/devel/qapi-code-gen.rst qapi/introspect.json +1 more+54 -101 reply
2/5qapi: Add feature flags to enum membersdocs/devel/qapi-code-gen.rst qapi/compat.json qapi/introspect.json +10 more+57 -141 reply
3/5qapi: Move compat policy from QObject to generic visitorinclude/qapi/qobject-input-visitor.h include/qapi/qobject-output-visitor.h include/qapi/visitor-impl.h +5 more+25 -361 reply
4/5qapi: Implement deprecated-input={reject, crash} for enum valuesinclude/qapi/util.h qapi/compat.json qapi/qapi-visit-core.c +1 more+38 -60 replies
5/5block: Deprecate transaction type drive-backupqapi/transaction.json+5 -17 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchEric BlakePeter KrempaJohn SnowVladimir Sementsov-Ogievskiy
1/5R-b T-b A-b R-b
2/5R-b R-b
3/5R-b
4/5R-b T-b A-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/5] qapi: Add feature flags to enum members

PATCH 1+2 add feature flags to enum members. Awkward due to an introspection design mistake; see PATCH 1 for details.

PATCH 3+4 implement policy deprecated-input={reject,crash} for enum values.

Policy deprecated-output=hide is not implemented, because we can't hide a value without hiding the entire member, which is almost certainly more than the requester of this policy bargained for. Perhaps we want a new policy deprecated-output=hide-or-else-crash to help us catch unwanted use of deprecated enum values. Perhaps we want deprecated-output=hide to behave that way together with deprecated-input=crash. Or even always. Thoughts?

PATCH 5 puts the new feature flags to use. It's RFC because it makes sense only on top of Vladimir's deprecation of drive-backup. See its commit message for a reference.

I prefer to commit new features together with a use outside tests/. PATCH 5 adds such a use, but it's RFC, because it depends on Vladimir's work. Perhaps another use pops up. I can delay this work in the hope of a use becoming ready, but the feature flags work I have in the pipeline will eventually force my hand.

v4:
* PATCH 1: Deprecate SchemaInfoEnum member @values.
* PATCH 2: Doc tweak

v3:
* PATCH 1+2: Update qapi-code-gen.rst [Kevin, Eric]
* PATCH 4: Commit message typo [Eric], doc update moved to PATCH 2
* PATCH 5: Doc comment FIXME resolved [Kevin]

v2:
* Rebased with straightforward conflicts.
* PATCH 1-4: No longer RFC.
* PATCH 1: "Since" information fixed [Eric]. Commit message updated to reflect feedback.
* PATCH 2: Commit message amended to point out special feature flag 'deprecated' is ignored at this stage.
* PATCH 4: Documentation updated. Commit message tweaked.

Markus Armbruster (5):
qapi: Enable enum member introspection to show more than name
qapi: Add feature flags to enum members
qapi: Move compat policy from QObject to generic visitor
qapi: Implement deprecated-input={reject,crash} for enum values
block: Deprecate transaction type drive-backup

 docs/about/deprecated.rst                     |  6 ++++
 docs/devel/qapi-code-gen.rst                  | 29 ++++++++++++++-----
 qapi/compat.json                              |  3 ++
 qapi/introspect.json                          | 28 ++++++++++++++++--
 qapi/transaction.json                         |  6 +++-
 include/qapi/qobject-input-visitor.h          |  4 ---
 include/qapi/qobject-output-visitor.h         |  4 ---
 include/qapi/util.h                           |  6 +++-
 include/qapi/visitor-impl.h                   |  3 ++
 include/qapi/visitor.h                        |  9 ++++++
 qapi/qapi-visit-core.c                        | 27 +++++++++++++++--
 qapi/qmp-dispatch.c                           |  4 +--
 qapi/qobject-input-visitor.c                  | 14 +--------
 qapi/qobject-output-visitor.c                 | 14 +--------
 scripts/qapi/expr.py                          |  3 +-
 scripts/qapi/introspect.py                    | 19 +++++++++---
 scripts/qapi/schema.py                        | 22 ++++++++++++--
 scripts/qapi/types.py                         | 17 ++++++++++-
 tests/qapi-schema/doc-good.json               |  5 +++-
 tests/qapi-schema/doc-good.out                |  3 ++
 tests/qapi-schema/doc-good.txt                |  3 ++
 .../qapi-schema/enum-dict-member-unknown.err  |  2 +-
 tests/qapi-schema/qapi-schema-test.json       |  3 +-
 tests/qapi-schema/qapi-schema-test.out        |  1 +
 tests/qapi-schema/test-qapi.py                |  1 +
 25 files changed, 174 insertions(+), 62 deletions(-)
Signature · 1 line
2.31.1