Skip to content

qapi: generalize special features

Daniel P. Berrangé qemu-devel 4 versions – Applied

Status from this message: Queued with imports tidied up. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 7 repliesApplied
  2. v34 patches 6 repliesSuperseded
  3. v24 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches15 repliesSuperseded

Changes in v4 from the cover letter

* Apply fixes to make mypy happy

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4qapi: cope with feature names containing a '-'scripts/qapi/gen.py+2 -10 replies
2/4qapi: change 'unsigned special_features' to 'uint64_t features'include/qapi/compat-policy.h include/qapi/qmp/dispatch.h include/qapi/util.h +10 more+34 -340 replies
3/4qapi: rename 'special_features' to 'features'scripts/qapi/commands.py scripts/qapi/gen.py scripts/qapi/types.py +1 more+18 -181 reply
4/4qapi: expose all schema features to codemeson.build scripts/qapi/commands.py scripts/qapi/features.py +10 more+113 -74 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPhilippe Mathieu-DaudéMarkus Armbruster
SeriesR-b
1/4
2/4R-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] qapi: generalize special features

This series is a spin-off from

https://lists.nongnu.org/archive/html/qemu-devel/2024-06/msg00807.html

That series introduced a pragma allowing a schema to declare extra features that would be exposed to code.

Following Markus' suggestion:

https://lists.nongnu.org/archive/html/qemu-devel/2024-07/msg03765.html

I've changed impl such that we expose all features to the code regardless of whether they are special, and don't require any pragma.

I've split it from the QGA patches since it makes more sense to work on this bit in isolation.

Changed in v4:

* Apply fixes to make mypy happy

Changed in v3:

* "make -C python check-tox" is now clean
* Added test case for "too many features" error scenario
* Don't sort the features enum, just rely on ordered dict
* Add 'features' accessor on QAPISchema instead of touching private data via 'schema._features.values()'

Changed in v2:

* Reference QapiSpecialFeature enums constants when defining QapiFeature enums constants for deprecated & unstable

* Don't expose qapi-features.h in qapi-types.h, to avoid global namespace pollution, instead pull it into only the .c files that need it. This avoids the need to add a 'prefix' to enum constants

* Collect all features during parse time, rather than generate time, to allow earlier error reporting of the 64 feature limit

Daniel P. Berrangé (4):
qapi: cope with feature names containing a '-'
qapi: change 'unsigned special_features' to 'uint64_t features'
qapi: rename 'special_features' to 'features'
qapi: expose all schema features to code

 include/qapi/compat-policy.h             |  2 +-
 include/qapi/qmp/dispatch.h              |  4 +-
 include/qapi/util.h                      |  2 +-
 include/qapi/visitor-impl.h              |  4 +-
 include/qapi/visitor.h                   | 12 +++---
 meson.build                              |  1 +
 qapi/qapi-forward-visitor.c              |  8 ++--
 qapi/qapi-util.c                         |  6 +--
 qapi/qapi-visit-core.c                   | 12 +++---
 qapi/qmp-dispatch.c                      |  2 +-
 qapi/qmp-registry.c                      |  4 +-
 qapi/qobject-input-visitor.c             |  4 +-
 qapi/qobject-output-visitor.c            |  6 +--
 scripts/qapi/commands.py                 |  5 ++-
 scripts/qapi/features.py                 | 51 ++++++++++++++++++++++++
 scripts/qapi/gen.py                      |  9 +++--
 scripts/qapi/main.py                     |  2 +
 scripts/qapi/schema.py                   | 31 +++++++++++++-
 scripts/qapi/types.py                    | 19 +++++----
 scripts/qapi/visit.py                    | 17 ++++----
 tests/meson.build                        |  2 +
 tests/qapi-schema/features-too-many.err  |  2 +
 tests/qapi-schema/features-too-many.json | 13 ++++++
 tests/qapi-schema/features-too-many.out  |  0
 tests/qapi-schema/meson.build            |  1 +
 25 files changed, 163 insertions(+), 56 deletions(-)
 create mode 100644 scripts/qapi/features.py
 create mode 100644 tests/qapi-schema/features-too-many.err
 create mode 100644 tests/qapi-schema/features-too-many.json
 create mode 100644 tests/qapi-schema/features-too-many.out
Signature · 1 line
2.47.1