dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch

7fae7f
From e1f0936bbf84664d7d7fe7bbbdd1595be745b539 Mon Sep 17 00:00:00 2001
96a5f8
From: Cole Robinson <crobinso@redhat.com>
96a5f8
Date: Tue, 19 Feb 2013 15:04:59 -0500
96a5f8
Subject: [PATCH] i8254: Fix migration from qemu-kvm < 1.1
96a5f8
96a5f8
qemu-kvm commit 81bdec908fb2be0ccaff1d4ee67956c509e440ad did this,
96a5f8
but the logic can't be carried unconditionally in qemu.git without
96a5f8
breaking migration from qemu < 1.1.
96a5f8
96a5f8
Conditionalize it with --enable-migrate-from-qemu-kvm
96a5f8
---
7fae7f
 hw/timer/i8254_common.c | 8 ++++++++
96a5f8
 1 file changed, 8 insertions(+)
96a5f8
7fae7f
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
7fae7f
index 5342df4..e74afe3 100644
7fae7f
--- a/hw/timer/i8254_common.c
7fae7f
+++ b/hw/timer/i8254_common.c
96a5f8
@@ -275,7 +275,15 @@ static const VMStateDescription vmstate_pit_common = {
96a5f8
     .pre_save = pit_dispatch_pre_save,
96a5f8
     .post_load = pit_dispatch_post_load,
96a5f8
     .fields = (VMStateField[]) {
96a5f8
+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
96a5f8
+        /* qemu-kvm version_id=2 had 'flags' here which is equivalent
96a5f8
+         * This fixes incoming migration from qemu-kvm 1.0, but breaks
96a5f8
+         * incoming migration from qemu < 1.1
96a5f8
+         */
96a5f8
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState),
96a5f8
+#else
96a5f8
         VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
96a5f8
+#endif
96a5f8
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
96a5f8
                              vmstate_pit_channel, PITChannelState),
96a5f8
         VMSTATE_INT64(channels[0].next_transition_time,