On Fri, Nov 06, 2026 at 03:03:43AM +0800, Yonggang Luo wrote: > Return the QEMU_ARCH_* mask of the selected target. System mode > returns QEMU_ARCH_ALL until a target is selected. User mode returns > that target's bit. Tools return 0.
I was wondering if it was better to have system mode return 0 or QEMU_ARCH_ALL, when no target is selected. I guess QEMU_ARCH_ALL (or a mask of all arches that are built-in to the bniary) is a better approach, as it expresses that the system's current state is capable of targetting any of the include arches, while '0' conceptually represents the "no arch specific features" scenario for tools. > > Signed-off-by: Yonggang Luo <[email protected]> > --- > include/qemu/target-info-init.h | 15 ++++++++++----- > include/qemu/target-info.h | 9 +++++++++ > stubs/meson.build | 1 + > stubs/target-mask-selected.c | 13 +++++++++++++ > target-info-def.c | 3 +++ > target-info-qom.c | 10 ++++++++++ > 6 files changed, 46 insertions(+), 5 deletions(-) > create mode 100644 stubs/target-mask-selected.c Reviewed-by: Daniel P. Berrangé <[email protected]> this patch looks applicable independently of this series. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
