All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] qom: pass TargetInfo to the is_available callback
@ 2026-10-07 11:47 Yonggang Luo
  2026-10-07 11:47 ` [PATCH 1/8] configs/targets: remove target info definitions Yonggang Luo
                   ` (9 more replies)
  0 siblings, 10 replies; 62+ messages in thread
From: Yonggang Luo @ 2026-10-07 11:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel P. Berrangé, Cleber Rosa, Stefan Hajnoczi,
	Cédric Le Goater, Laurent Vivier, Zhao Liu, John Snow,
	Laurent Vivier, Richard Henderson, Joel Stanley, Fabiano Rosas,
	Kane Chen, Andrew Jeffery, Troy Lee, Jamin Lin, Stafford Horne,
	Pierrick Bouvier, qemu-arm, Philippe Mathieu-Daude, Peter Maydell,
	Paolo Bonzini, Philippe Mathieu-Daudé,
	Marc-André Lureau, Steven Lee, Alexander Bulekov,
	Darren Kenny

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

-- 
2.55.0.windows.3



^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2026-10-13 15:56 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 11:47 [PATCH 0/8] qom: pass TargetInfo to the is_available callback Yonggang Luo
2026-10-07 11:47 ` [PATCH 1/8] configs/targets: remove target info definitions Yonggang Luo
2026-10-07 20:26   ` Pierrick Bouvier
2026-10-08  9:46     ` Philippe Mathieu-Daudé
2026-10-07 11:47 ` [PATCH 2/8] target-info: rename target-info-stub.c in target-info-def.c Yonggang Luo
2026-10-07 11:48 ` [PATCH 3/8] target-info: rename target-info-impl.h to target-info-def.h Yonggang Luo
2026-10-07 20:27   ` Pierrick Bouvier
2026-10-07 11:48 ` [PATCH 4/8] target-info: replace QOM registration with a constructor list Yonggang Luo
2026-10-07 20:29   ` Pierrick Bouvier
2026-10-07 20:50     ` Yonggang Luo
2026-10-07 22:31       ` Pierrick Bouvier
2026-10-07 22:54         ` Yonggang Luo
2026-10-07 23:24           ` Pierrick Bouvier
2026-10-13  9:26             ` Daniel P. Berrangé
2026-10-13 15:53               ` Pierrick Bouvier
2026-10-07 23:02         ` Yonggang Luo
2026-10-07 23:28           ` Pierrick Bouvier
2026-10-12 21:27             ` Yonggang Luo
2026-10-13  3:57               ` Pierrick Bouvier
2026-10-13  8:58                 ` Yonggang Luo
2026-10-07 11:48 ` [PATCH 5/8] tests/unit: add target-info coverage for multi-target builds Yonggang Luo
2026-10-07 11:48 ` [PATCH 6/8] meson: load all target .mak files into target_mak_all Yonggang Luo
2026-10-07 20:30   ` Pierrick Bouvier
2026-10-07 11:48 ` [PATCH 7/8] target-info: Replace handwritten architecture checks with generated code Yonggang Luo
2026-10-07 20:36   ` Pierrick Bouvier
2026-10-07 11:48 ` [PATCH 8/8] qom: pass TargetInfo to is_available for later use Yonggang Luo
2026-10-07 20:44   ` Pierrick Bouvier
2026-10-07 21:42     ` Yonggang Luo
2026-10-08  0:00       ` Pierrick Bouvier
2026-10-08  0:03         ` Pierrick Bouvier
2026-10-08  2:08         ` Yonggang Luo
2026-10-08 15:58           ` Pierrick Bouvier
2026-10-08  9:36         ` Daniel P. Berrangé
2026-10-08  9:56           ` Yonggang Luo
2026-10-08 16:01             ` Pierrick Bouvier
2026-10-08 17:04               ` Yonggang Luo
2026-10-08 18:26                 ` Pierrick Bouvier
2026-10-08 18:33                   ` Yonggang Luo
2026-10-08 18:40                     ` Pierrick Bouvier
2026-10-07 20:25 ` [PATCH 0/8] qom: pass TargetInfo to the is_available callback Pierrick Bouvier
2026-10-08  9:42   ` Daniel P. Berrangé
2026-10-08  9:46     ` Yonggang Luo
2026-10-08 16:06       ` Pierrick Bouvier
2026-10-08 17:13         ` Yonggang Luo
2026-10-08 18:34           ` Pierrick Bouvier
2026-10-08 18:48             ` Yonggang Luo
2026-10-11 20:22             ` Yonggang Luo
2026-10-12  2:13               ` Pierrick Bouvier
2026-10-12  2:21                 ` Yonggang Luo
2026-10-12  2:25                 ` Pierrick Bouvier
2026-10-12  4:26                   ` Yonggang Luo
2026-10-12  7:11                     ` Pierrick Bouvier
2026-10-13  1:26                     ` Pierrick Bouvier
2026-10-13  2:43                       ` Yonggang Luo
2026-10-13  3:53                         ` Pierrick Bouvier
2026-10-13  4:03                           ` Yonggang Luo
2026-10-13 15:56                             ` Pierrick Bouvier
2026-10-11 20:32             ` Yonggang Luo
2026-10-07 20:46 ` Pierrick Bouvier
2026-10-09 21:58   ` Pierrick Bouvier
2026-10-09 22:08     ` Yonggang Luo
2026-10-09 22:21       ` Pierrick Bouvier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.