summary refs log tree commit diff stats
path: root/system/vl.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-23 22:46:34 +0100
committerRichard Henderson <richard.henderson@linaro.org>2025-04-30 12:51:51 -0700
commit28502121be7b1422af55bbed6f65a273b889ef01 (patch)
treecab367c0655a7f06621660a7d013de82cc89aaf8 /system/vl.c
parent5e5a9aea793cfd67541153105b6046436f6ae4a8 (diff)
downloadfocaccia-qemu-28502121be7b1422af55bbed6f65a273b889ef01.tar.gz
focaccia-qemu-28502121be7b1422af55bbed6f65a273b889ef01.zip
system/vl: Filter machine list available for a particular target binary
Binaries can register a QOM type to filter their machines
by filling their TargetInfo::machine_typename field.

This can be used by example by main() -> machine_help_func()
to filter the machines list.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'system/vl.c')
-rw-r--r--system/vl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/vl.c b/system/vl.c
index 520956f4a1..7223f1ff17 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -27,6 +27,7 @@
 #include "qemu/datadir.h"
 #include "qemu/units.h"
 #include "qemu/module.h"
+#include "qemu/target-info.h"
 #include "exec/cpu-common.h"
 #include "exec/page-vary.h"
 #include "hw/qdev-properties.h"
@@ -1564,7 +1565,7 @@ static void machine_help_func(const QDict *qdict)
     GSList *el;
     const char *type = qdict_get_try_str(qdict, "type");
 
-    machines = object_class_get_list(TYPE_MACHINE, false);
+    machines = object_class_get_list(target_machine_typename(), false);
     if (type) {
         ObjectClass *machine_class = OBJECT_CLASS(find_machine(type, machines));
         if (machine_class) {