qom: pass TargetInfo to the is_available callback
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 53 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | configs/targets: remove target info definitionsMAINTAINERS configs/ configs/ +4 more | +1 | 2 replies | |
| 2/8 | target-info: rename target-info-stub.c in target-info-def.cinclude/ meson.build target-info-def.c | +2 | 0 replies | |
| 3/8 | target-info: rename target-info-impl.h to target-info-def.hinclude/ include/ page-vary-common.c +4 more | +8 | 1 reply | |
| 4/8 | target-info: replace QOM registration with a constructor listinclude/ include/ include/ +9 more | +129 | 12 replies | |
| 5/8 | tests/unit: add target-info coverage for multi-target buildsMAINTAINERS meson.build tests/ +1 more | +47 | 0 replies | |
| 6/8 | meson: load all target .mak files into target_mak_allmeson.build | +16 | 1 reply | |
| 7/8 | target-info: Replace handwritten architecture checks with generated codeinclude/ meson.build scripts/ +1 more | +125 | 1 reply | |
| 8/8 | qom: pass TargetInfo to is_available for later usehw/ hw/ hw/ +6 more | +24 | 13 replies |
Reviews trailers per patch
1 of 8 patches has a Reviewed-by or Acked-by.
| Patch | Pierrick Bouvier |
|---|---|
| 1/8 | |
| 2/8 | |
| 3/8 | R-b |
| 4/8 | |
| 5/8 | |
| 6/8 | |
| 7/8 | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/8] qom: pass TargetInfo to the is_available callback
This allows a combined binary to register machine types from all its targets. Consequently, QMP query-machines can return machine entries from every target, even when none is selected. For example, a client can query the combined machine list with:
```json
{ "execute": "query-machines" }
```The returned list includes the registered machine classes from all linked targets. This is separate from selecting a machine: with -target none, -M virt reports the targets that provide virt instead of choosing one arbitrarily:
```text qemu-system -target none -M virt unsupported machine type: "virt" for target "none" Available for targets: aarch64 arm ```
It moves target_info() to a shared location so object.c can call it when checking machine availability. The series also replaces QOM-based target-info registration with a constructor list and passes TargetInfo to the is_available callback.
Target metadata and architecture checks are generated from the configured targets, there is too much arch to write biiolperate code. doing this for easier Add TargetInfo* to is_available
The target-info API and implementation are shared, rather than compiled separately for every target.
This series removes the per-target source files "configs/targets/*.c". Their target-specific parameters are collected in a generated target-info-def.c for each softmmu target. This lays the groundwork for QEMU system builds in which target-info-def.c is the only target-specific source file compiled for each target. Using the same filename lets meson.build handle these definitions uniformly.
The series adds unit-test coverage for target info and multi-target builds.
Pierrick Bouvier (2):
configs/targets: remove target info definitions
target-info: rename target-info-stub.c in target-info-def.c
Yonggang Luo (6):
target-info: rename target-info-impl.h to target-info-def.h
target-info: replace QOM registration with a constructor list tests/unit: add target-info coverage for multi-target builds
meson: load all target .mak files into target_mak_all
target-info: Replace handwritten architecture checks with generated
code
qom: pass TargetInfo to is_available for later use
MAINTAINERS | 2 +- configs/targets/aarch64-softmmu.c | 25 ------ configs/targets/arm-softmmu.c | 25 ------ configs/targets/meson.build | 6 -- configs/targets/riscv32-softmmu.c | 24 ----- configs/targets/riscv64-softmmu.c | 24 ----- hw/arm/aspeed_ast27x0-fc.c | 2 +- hw/arm/aspeed_ast27x0_evb.c | 4 +- hw/arm/raspi.c | 4 +- hw/arm/raspi4b.c | 2 +- hw/arm/virt.c | 4 +- hw/m68k/virt.c | 4 +- hw/or1k/virt.c | 2 +- include/hw/core/cpu.h | 2 +- include/qemu/module.h | 1 - include/qemu/target-info-def.h | 88 ++++++++++++++++++ include/qemu/target-info-impl.h | 42 --------- include/qemu/target-info-init.h | 53 ----------- include/qemu/target-info-qom.h | 31 ------- include/qemu/target-info.h | 87 ++++-------------- include/qom/object.h | 12 ++- meson.build | 52 ++++++++--- page-vary-common.c | 2 +- page-vary-system.c | 2 +- qom/object.c | 3 +- scripts/gen-target-info.py | 99 ++++++++++++++++++++ system/vl.c | 4 - target-info-stub.c => target-info-def.c | 3 +- target-info-qom.c | 60 ------------- target-info.c | 115 ++++++++++++------------ tests/qtest/fuzz/fuzz.c | 3 - tests/unit/meson.build | 4 + tests/unit/test-multi-target.c | 12 +-- tests/unit/test-target-info.c | 38 ++++++++ 34 files changed, 379 insertions(+), 462 deletions(-) delete mode 100644 configs/targets/aarch64-softmmu.c delete mode 100644 configs/targets/arm-softmmu.c delete mode 100644 configs/targets/meson.build delete mode 100644 configs/targets/riscv32-softmmu.c delete mode 100644 configs/targets/riscv64-softmmu.c create mode 100644 include/qemu/target-info-def.h delete mode 100644 include/qemu/target-info-impl.h delete mode 100644 include/qemu/target-info-init.h delete mode 100644 include/qemu/target-info-qom.h create mode 100644 scripts/gen-target-info.py rename target-info-stub.c => target-info-def.c (94%) delete mode 100644 target-info-qom.c create mode 100644 tests/unit/test-target-info.c
Signature · 1 line
2.55.0.windows.3