summary refs log tree commit diff stats
path: root/target-info.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-08 23:53:14 +0200
committerMichael S. Tsirkin <mst@redhat.com>2025-07-15 02:56:39 -0400
commit536613be40c7005a956a52487c1fed4530d6613f (patch)
treeda9d445f9b0c77e89a4d933ce91d8257294008c9 /target-info.c
parent0af00042a9290626e3c9f05cdc35b6e3d62ecd49 (diff)
downloadfocaccia-qemu-536613be40c7005a956a52487c1fed4530d6613f.tar.gz
focaccia-qemu-536613be40c7005a956a52487c1fed4530d6613f.zip
qemu/target-info: Add %target_arch field to TargetInfo
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250708215320.70426-4-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'target-info.c')
-rw-r--r--target-info.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/target-info.c b/target-info.c
index 9ebabec988..8e29553b4e 100644
--- a/target-info.c
+++ b/target-info.c
@@ -24,8 +24,13 @@ unsigned target_long_bits(void)
 
 SysEmuTarget target_arch(void)
 {
-    return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
-                           &error_abort);
+    SysEmuTarget arch = target_info()->target_arch;
+
+    if (arch == SYS_EMU_TARGET__MAX) {
+        arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
+                               &error_abort);
+    }
+    return arch;
 }
 
 const char *target_cpu_type(void)