summaryrefslogtreecommitdiffstats
path: root/cpu.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2021-05-17 12:51:28 +0200
committerRichard Henderson2021-05-27 00:33:59 +0200
commit4336073b9b13943e050edfe9aebb99974c3b6ee1 (patch)
treef4a2f44855ad29dad392f2013dac2f3cadd41a71 /cpu.c
parentcpu: Directly use get_memory_mapping() fallback handlers in place (diff)
downloadqemu-4336073b9b13943e050edfe9aebb99974c3b6ee1.tar.gz
qemu-4336073b9b13943e050edfe9aebb99974c3b6ee1.tar.xz
qemu-4336073b9b13943e050edfe9aebb99974c3b6ee1.zip
cpu: Assert DeviceClass::vmsd is NULL on user emulation
Migration is specific to system emulation. Restrict current DeviceClass::vmsd to sysemu using #ifdef'ry, and assert in cpu_exec_realizefn() that dc->vmsd not set under user emulation. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210517105140.1062037-12-f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cpu.c b/cpu.c
index 34a0484bf4..6fe4af2797 100644
--- a/cpu.c
+++ b/cpu.c
@@ -141,6 +141,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
#endif /* CONFIG_TCG */
#ifdef CONFIG_USER_ONLY
+ assert(qdev_get_vmsd(DEVICE(cpu)) == NULL ||
+ qdev_get_vmsd(DEVICE(cpu))->unmigratable);
assert(cc->vmsd == NULL);
#else
if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {