render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch

7fae7f
From 9df0fd5765377d32a0e9f2d855dc1d428c19f767 Mon Sep 17 00:00:00 2001
96a5f8
From: Cole Robinson <crobinso@redhat.com>
96a5f8
Date: Tue, 19 Feb 2013 14:44:49 -0500
96a5f8
Subject: [PATCH] acpi_piix4: Drop minimum_version_id to handle qemu-kvm
96a5f8
 migration
96a5f8
96a5f8
qemu-kvm 1.2 advertised version_id=2, but it was not the same
96a5f8
format as qemu.git version_id=2.
96a5f8
96a5f8
commit b0b873a07872f7ab7f66f259c73fb9dd42aa66a9 added the qemu-kvm
96a5f8
format to qemu.git, but was forced to call it version_id=3, and
96a5f8
bumped minimum_version_id to 3. This breaks incoming migration from
96a5f8
qemu-kvm.
96a5f8
96a5f8
If --enable-migration-from-qemu-kvm is enabled, drop minimum_version_id
96a5f8
to 2. Migration from qemu-kvm version_id=2 and qemu 1.3+ version_id=3
96a5f8
works, but migration from qemu < 1.3 is broken.
96a5f8
---
7fae7f
 hw/acpi/piix4.c | 15 +++++++++------
96a5f8
 1 file changed, 9 insertions(+), 6 deletions(-)
96a5f8
7fae7f
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
7fae7f
index c4af1cc..95d227d 100644
7fae7f
--- a/hw/acpi/piix4.c
7fae7f
+++ b/hw/acpi/piix4.c
7fae7f
@@ -269,16 +269,19 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
96a5f8
     return ret;
96a5f8
 }
96a5f8
 
96a5f8
-/* qemu-kvm 1.2 uses version 3 but advertised as 2
96a5f8
- * To support incoming qemu-kvm 1.2 migration, change version_id
96a5f8
- * and minimum_version_id to 2 below (which breaks migration from
96a5f8
- * qemu 1.2).
96a5f8
- *
96a5f8
- */
96a5f8
 static const VMStateDescription vmstate_acpi = {
96a5f8
     .name = "piix4_pm",
96a5f8
     .version_id = 3,
96a5f8
+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
96a5f8
+    /*
96a5f8
+     * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2.
96a5f8
+     * This allows incoming migration from qemu-kvm, but breaks incoming
96a5f8
+     * migration from qemu < 1.3.
96a5f8
+     */
96a5f8
+    .minimum_version_id = 2,
96a5f8
+#else
96a5f8
     .minimum_version_id = 3,
96a5f8
+#endif
96a5f8
     .minimum_version_id_old = 1,
96a5f8
     .load_state_old = acpi_load_old,
96a5f8
     .post_load = vmstate_acpi_post_load,