This series prepares QOM to hold more than one TypeImpl under the same name, one per target, so a multi-target binary can register same-name types without renaming them. Nothing uses it yet.
type_table maps each name to a TypeBucket, which holds the variants and the union of their QEMU_ARCH_* masks. Registration still aborts when masks overlap, and a name lookup returns the one variant left for the selected target. type_register_targets() registers a variant for a target mask. type_register_static() is unchanged, so binaries keep one TypeImpl per name. The change stays in qom and target-info and does not conflict with the virt QOM name or is_available series. Daniel asked what a TypeBucket means. This is that prototype, based on the bucket idea from Pierrick. Daniel: what a TypeBucket means: Link: https://lore.kernel.org/qemu-devel/[email protected]/ Pierrick: register types per target bucket: Link: https://lore.kernel.org/qemu-devel/[email protected]/ Pierrick: the bucket work can proceed in parallel: Link: https://lore.kernel.org/qemu-devel/cae2xoe-iocdgxptg7mqydmahpnotfm_15dr0ejkgmrqkxrg...@mail.gmail.com/ Yonggang Luo (5): qom: store registration targets on TypeImpl target-info: add target_mask_selected() qom: add target_mask_filter() qom: filter type lookup with TypeBucket qom: add type_register_targets() include/qemu/target-info-init.h | 15 ++- include/qemu/target-info.h | 9 ++ include/qom/object.h | 12 +++ qom/object.c | 168 ++++++++++++++++++++++++++------ stubs/meson.build | 1 + stubs/target-mask-selected.c | 13 +++ target-info-def.c | 3 + target-info-qom.c | 10 ++ 8 files changed, 197 insertions(+), 34 deletions(-) create mode 100644 stubs/target-mask-selected.c -- 2.55.0.windows.3
