diff mbox

[4/8] exec: add missing conditional compilation

Message ID 146723345764.9665.10396782874695715921.stgit@bahia.lan (mailing list archive)
State New, archived
Headers show

Commit Message

Greg Kurz June 29, 2016, 8:50 p.m. UTC
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 <groug@kaod.org>
---
 exec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

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)
 {