diff mbox

[2/2] Increment version id for CPU save state

Message ID 1241038430-7444-3-git-send-email-aliguori@us.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anthony Liguori April 29, 2009, 8:53 p.m. UTC
9 is reserved for KVM.  KVM cannot support migration from any other version.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 target-i386/cpu.h     |    4 +++-
 target-i386/machine.c |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index f054af1..af0ee18 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -838,7 +838,9 @@  static inline int cpu_get_time_fast(void)
 #define cpu_signal_handler cpu_x86_signal_handler
 #define cpu_list x86_cpu_list
 
-#define CPU_SAVE_VERSION 8
+/* CPU_SAVE_VERSION 9 is reserved for KVM.  This is to avoid breakage as KVM
+ * merges into upstream QEMU */
+#define CPU_SAVE_VERSION 9
 
 /* MMU modes definitions */
 #define MMU_MODE0_SUFFIX _kernel
diff --git a/target-i386/machine.c b/target-i386/machine.c
index 399204d..7f75d31 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -196,6 +196,9 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
     if (version_id != 3 && version_id != 4 && version_id != 5
         && version_id != 6 && version_id != 7 && version_id != 8)
         return -EINVAL;
+    /* KVM cannot accept migrations from QEMU today */
+    if (version_id != 9)
+        return -EINVAL;
     for(i = 0; i < CPU_NB_REGS; i++)
         qemu_get_betls(f, &env->regs[i]);
     qemu_get_betls(f, &env->eip);