Patchwork [2/4] acpi_piix4: Drop minimum_version_id to handle qemu-kvm migration

login
register
mail settings
Submitter Cole Robinson
Date Feb. 19, 2013, 10:40 p.m.
Message ID <b6feefb51ccf6acb5bb7ad6439bce64bfd0522fc.1361313340.git.crobinso@redhat.com>
Download mbox | patch
Permalink /patch/221912/
State New
Headers show

Comments

Cole Robinson - Feb. 19, 2013, 10:40 p.m.
qemu-kvm 1.2 advertised version_id=2, but it was not the same
format as qemu.git version_id=2.

commit b0b873a07872f7ab7f66f259c73fb9dd42aa66a9 added the qemu-kvm
format to qemu.git, but was forced to call it version_id=3, and
bumped minimum_version_id to 3. This breaks incoming migration from
qemu-kvm.

If --enable-migration-from-qemu-kvm is enabled, drop minimum_version_id
to 2. Migration from qemu-kvm version_id=2 and qemu 1.3+ version_id=3
works, but migration from qemu < 1.3 is broken.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 hw/acpi_piix4.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Patch

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 65b2601..e3d2e41 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -257,16 +257,19 @@  static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
     return ret;
 }
 
-/* qemu-kvm 1.2 uses version 3 but advertised as 2
- * To support incoming qemu-kvm 1.2 migration, change version_id
- * and minimum_version_id to 2 below (which breaks migration from
- * qemu 1.2).
- *
- */
 static const VMStateDescription vmstate_acpi = {
     .name = "piix4_pm",
     .version_id = 3,
+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
+    /*
+     * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2.
+     * This allows incoming migration from qemu-kvm, but breaks incoming
+     * migration from qemu < 1.3.
+     */
+    .minimum_version_id = 2,
+#else
     .minimum_version_id = 3,
+#endif
     .minimum_version_id_old = 1,
     .load_state_old = acpi_load_old,
     .post_load = vmstate_acpi_post_load,