diff mbox

[02/25] vmstate: Simplify test for CPU_SAVE_VERSION

Message ID f23db1eb1d7e28da9e2972c77aa66d3130e5c0c9.1319550280.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Oct. 25, 2011, 2 p.m. UTC
Some cpu's definitions define CPU_SAVE_VERSION, others not, but they have
defined cpu_save/load.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 exec.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/exec.c b/exec.c
index 9dc4edb..165cfe8 100644
--- a/exec.c
+++ b/exec.c
@@ -591,7 +591,7 @@  void cpu_exec_init_all(void)
 #endif
 }

-#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
+#if !defined(CONFIG_USER_ONLY)

 static int cpu_common_post_load(void *opaque, int version_id)
 {
@@ -658,11 +658,13 @@  void cpu_exec_init(CPUState *env)
 #if defined(CONFIG_USER_ONLY)
     cpu_list_unlock();
 #endif
-#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
+#if !defined(CONFIG_USER_ONLY)
     vmstate_register(NULL, cpu_index, &vmstate_cpu_common, env);
+#if defined(CPU_SAVE_VERSION)
     register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
                     cpu_save, cpu_load, env);
 #endif
+#endif
 }

 /* Allocate a new translation block. Flush the translation buffer if