Commit 741da0d38 "hw: cannot include hw/hw.h from user emulation" also
switched off compilation of the vmstate bits in cpu_exec_init() for user
mode.

This patch does the same in cpu_exec_exit() because user mode shouldn't
call vmstate_unregister() either.

Signed-off-by: Greg Kurz <gr...@kaod.org>
---
 exec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/exec.c b/exec.c
index 0122ef76de5d..a528a1e6bbf6 100644
--- a/exec.c
+++ b/exec.c
@@ -654,17 +654,18 @@ void cpu_exec_exit(CPUState *cpu)
     QTAILQ_REMOVE(&cpus, cpu, node);
     cpu_release_index(cpu);
     cpu->cpu_index = -1;
 #if defined(CONFIG_USER_ONLY)
+    (void) cc;
     cpu_list_unlock();
-#endif
-
+#else
     if (cc->vmsd != NULL) {
         vmstate_unregister(NULL, cc->vmsd, cpu);
     }
     if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
         vmstate_unregister(NULL, &vmstate_cpu_common, cpu);
     }
+#endif
 }
 
 void cpu_exec_init(CPUState *cpu, Error **errp)
 {


Reply via email to