summary refs log tree commit diff stats
path: root/hw/core/machine-qmp-cmds.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-04-24 18:04:34 +0200
committerThomas Huth <thuth@redhat.com>2023-05-16 09:14:18 +0200
commit89c81b3d4c1ccafa22f58a6169c9410003654b8e (patch)
tree3fbbef7a25b01398b56d384baac0a5b84d9bb63e /hw/core/machine-qmp-cmds.c
parent1077f50b23065a1d07cbbc6bad1141d50a5d25b9 (diff)
downloadfocaccia-qemu-89c81b3d4c1ccafa22f58a6169c9410003654b8e.tar.gz
focaccia-qemu-89c81b3d4c1ccafa22f58a6169c9410003654b8e.zip
hw/core: Move machine-qmp-cmds.c into the target independent source set
The only target specific code that is left in here are two spots that
use TARGET_NAME. Change them to use the new target_name() wrapper
function instead, so we can move the file into the common softmmu_ss
source set. That way we only have to compile this file once, and not
for each target anymore.

Message-Id: <20230424160434.331175-4-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/core/machine-qmp-cmds.c')
-rw-r--r--hw/core/machine-qmp-cmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index c158c02aa3..3860a50c3b 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -37,7 +37,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
     MachineState *ms = MACHINE(qdev_get_machine());
     MachineClass *mc = MACHINE_GET_CLASS(ms);
     CpuInfoFastList *head = NULL, **tail = &head;
-    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME,
+    SysEmuTarget target = qapi_enum_parse(&SysEmuTarget_lookup, target_name(),
                                           -1, &error_abort);
     CPUState *cpu;
 
@@ -117,7 +117,7 @@ TargetInfo *qmp_query_target(Error **errp)
 {
     TargetInfo *info = g_malloc0(sizeof(*info));
 
-    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, TARGET_NAME, -1,
+    info->arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
                                  &error_abort);
 
     return info;