@samitouri / QOSamiQemu / commits / 21cf32635e

target/loongarch: Avoid target-specific migration headers in machine.c

machine.c doesn't use any target-specific macro defined by the "migration/cpu.h" header. Use the minimum header required: "migration/qemu-file-types.h" which is not target-specific. This allows to build this file as common object. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260325211728.89204-3-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 25, 2026 at 20:18 UTC 21cf32635e0ccd81c0bb3f5ec2425d2704f9de68
2 files changed +2 -2
target/loongarch/machine.c
+1 -1
@@ -7,7 +7,7 @@
7
8 #include "qemu/osdep.h"
9 #include "cpu.h"
10 -#include "migration/cpu.h"
10 +#include "migration/vmstate.h"
11 #include "system/tcg.h"
12 #include "vec.h"
13
target/loongarch/meson.build
+1 -1
@@ -10,6 +10,7 @@ loongarch_user_ss.add(files('gdbstub.c'))
10
11 loongarch_common_system_ss = ss.source_set()
12 loongarch_common_system_ss.add(files('gdbstub.c'))
13 +loongarch_common_system_ss.add(files('machine.c'))
14
15 loongarch_system_ss = ss.source_set()
16 loongarch_system_ss.add(files(
@@ -17,7 +18,6 @@ loongarch_system_ss.add(files(
18 'cpu_helper.c',
19 'csr.c',
20 'loongarch-qmp-cmds.c',
20 - 'machine.c',
21 ))
22
23 common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen])