All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] single-binary: implement dynamic filtering for machine types
@ 2026-08-21 23:51 Pierrick Bouvier
  2026-08-21 23:51 ` [PATCH v2 1/2] qom/object: add available_if field to TypeInfo Pierrick Bouvier
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pierrick Bouvier @ 2026-08-21 23:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, philmd, Daniel P. Berrangé, anjo,
	Pierrick Bouvier

Now that we can link a single-binary with at least two targets (arm, aarch64),
we want to make sure that we expose the same set of machines (later devices and
cpus) than target binaries. For that, we implemented a static filtering based on
target interfaces that each machine will implement to declare which targets have
this machine.

However, we discovered that this static filtering is not enough. Indeed, some
machines and devices do not depend only on target, and their presence can depend
on Kconfig or host/target combination. Thus, our static approach can't work, and
we need something more flexible.

In v1:
This series adds a new TYPE_TARGET_SPECIFIC, that declare a single function
bool is_available(void). From there, any machine type (and later devices and
cpus) can implement it to override their presence for each target.
We first replace the existing static mechanism with this, and once done, we
cleanup all the old interface. One nice benefit is that we can get rid of
config/targets/*.c files, which saves duplication.
In v2:
Suggested by Daniel, we share a list of requirement for type to be available,
for future introspection needs.

This series was tested by comparing list of machines for all qemu system
binaries, before and after this change, to make sure we don't introduce a
regression.

v2
--

Changed the design to use a list of requirements instead of a callback.
Implement it on one machine to show usage and get feedback before going further.

Pierrick Bouvier (2):
  qom/object: add available_if field to TypeInfo
  remote/machine: add available_if for x-remote machine type

 hw/remote/machine.c        |  3 ++-
 include/qemu/target-info.h | 11 +++++++++++
 include/qom/object.h       |  5 +++++
 qom/object.c               | 10 ++++++++++
 rust/qom/src/qom.rs        |  1 +
 stubs/meson.build          |  1 +
 stubs/target-info.c        | 11 +++++++++++
 target-info.c              | 13 +++++++++++++
 8 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 stubs/target-info.c

-- 
2.43.0



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

end of thread, other threads:[~2026-08-28 23:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 23:51 [PATCH v2 0/2] single-binary: implement dynamic filtering for machine types Pierrick Bouvier
2026-08-21 23:51 ` [PATCH v2 1/2] qom/object: add available_if field to TypeInfo Pierrick Bouvier
2026-08-22 14:23   ` Richard Henderson
2026-08-24  6:53     ` Pierrick Bouvier
2026-08-24  8:39       ` Yonggang Luo
2026-08-24 16:17         ` Pierrick Bouvier
2026-08-24  6:01   ` Markus Armbruster
2026-08-24 15:29     ` Pierrick Bouvier
2026-08-21 23:51 ` [PATCH v2 2/2] remote/machine: add available_if for x-remote machine type Pierrick Bouvier
2026-08-28 23:06 ` [PATCH v2 0/2] single-binary: implement dynamic filtering for machine types 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.