summary refs log tree commit diff stats
path: root/hw/core/cpu-user.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-23 19:56:20 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-09 17:00:46 +0100
commitca05578fc80f4253ed19f4c4128a4cbd5b83f0b5 (patch)
tree29c58801fd4b070fd8dc1a2a5acdbaa0fe7769a6 /hw/core/cpu-user.c
parent1405d7e60d8c98a28b29885f70da4f2e4407fbc6 (diff)
downloadfocaccia-qemu-ca05578fc80f4253ed19f4c4128a4cbd5b83f0b5.tar.gz
focaccia-qemu-ca05578fc80f4253ed19f4c4128a4cbd5b83f0b5.zip
cpus: Register VMState per user / system emulation
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é <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250123234415.59850-20-philmd@linaro.org>
Diffstat (limited to 'hw/core/cpu-user.c')
-rw-r--r--hw/core/cpu-user.c12
1 files changed, 12 insertions, 0 deletions
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 */
+}