From ca05578fc80f4253ed19f4c4128a4cbd5b83f0b5 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 23 Jan 2025 19:56:20 +0100 Subject: cpus: Register VMState per user / system emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplify cpu-target.c by extracting mixed vmstate code into the cpu_vmstate_register() / cpu_vmstate_unregister() helpers, implemented in cpu-user.c and cpu-system.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-20-philmd@linaro.org> --- hw/core/cpu-user.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/core/cpu-user.c') diff --git a/hw/core/cpu-user.c b/hw/core/cpu-user.c index cdd8de2fef..1892acdee0 100644 --- a/hw/core/cpu-user.c +++ b/hw/core/cpu-user.c @@ -10,6 +10,7 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/core/cpu.h" +#include "migration/vmstate.h" static const Property cpu_user_props[] = { /* @@ -30,3 +31,14 @@ void cpu_exec_initfn(CPUState *cpu) { /* nothing to do */ } + +void cpu_vmstate_register(CPUState *cpu) +{ + assert(qdev_get_vmsd(DEVICE(cpu)) == NULL || + qdev_get_vmsd(DEVICE(cpu))->unmigratable); +} + +void cpu_vmstate_unregister(CPUState *cpu) +{ + /* nothing to do */ +} -- cgit 1.4.1