summary refs log tree commit diff stats
path: root/target-info.c
diff options
context:
space:
mode:
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)