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>
This commit is contained in:
parent
1077f50b23
commit
89c81b3d4c
@ -37,7 +37,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp)
|
|||||||
MachineState *ms = MACHINE(qdev_get_machine());
|
MachineState *ms = MACHINE(qdev_get_machine());
|
||||||
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
MachineClass *mc = MACHINE_GET_CLASS(ms);
|
||||||
CpuInfoFastList *head = NULL, **tail = &head;
|
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);
|
-1, &error_abort);
|
||||||
CPUState *cpu;
|
CPUState *cpu;
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ TargetInfo *qmp_query_target(Error **errp)
|
|||||||
{
|
{
|
||||||
TargetInfo *info = g_malloc0(sizeof(*info));
|
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);
|
&error_abort);
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
@ -41,6 +41,7 @@ softmmu_ss.add(files(
|
|||||||
'gpio.c',
|
'gpio.c',
|
||||||
'loader.c',
|
'loader.c',
|
||||||
'machine-hmp-cmds.c',
|
'machine-hmp-cmds.c',
|
||||||
|
'machine-qmp-cmds.c',
|
||||||
'machine.c',
|
'machine.c',
|
||||||
'nmi.c',
|
'nmi.c',
|
||||||
'null-machine.c',
|
'null-machine.c',
|
||||||
@ -51,7 +52,3 @@ softmmu_ss.add(files(
|
|||||||
'vm-change-state-handler.c',
|
'vm-change-state-handler.c',
|
||||||
'clock-vmstate.c',
|
'clock-vmstate.c',
|
||||||
))
|
))
|
||||||
|
|
||||||
specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files(
|
|
||||||
'machine-qmp-cmds.c',
|
|
||||||
))
|
|
||||||
|
Loading…
Reference in New Issue
Block a user