Blame SOURCES/kvm-qemu-kvm-Fix-migration-from-older-version-due-to-i8254-changes.patch

d81766
From 9e78c7b16a7d6ce25cbf40affbc309b90b913a2b Mon Sep 17 00:00:00 2001
d81766
From: Miroslav Rezanina <mrezanin@redhat.com>
d81766
Date: Wed, 31 Jul 2013 08:01:44 +0200
d81766
Subject: qemu-kvm: Fix migration from older version due to i8254 changes
d81766
d81766
Message-id: <1375201922-6794-2-git-send-email-armbru@redhat.com>
d81766
Patchwork-id: 52815
d81766
O-Subject: [RHEL-7 PATCH v3 01/15] qemu-kvm: Fix migration from older version due to i8254 changes
d81766
Bugzilla: 983991
d81766
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
d81766
RH-Acked-by: Bandan Das <bsd@redhat.com>
d81766
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
d81766
d81766
Old qemu-kvm already contained an equivalent field to i8254's
d81766
irq_disabled. We therefore have to remove upstream's version restriction
d81766
here to allow migration from older versions.
d81766
d81766
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
d81766
Signed-off-by: Avi Kivity <avi@redhat.com>
d81766
(cherry picked from commit 81bdec908fb2be0ccaff1d4ee67956c509e440ad)
d81766
d81766
Conflicts:
d81766
        hw/i8254.c
d81766
d81766
Picked from qemu-kvm-1.1.
d81766
d81766
qemu-kvm-0.11.0 commit f69b3e2 added PITState member flags, added it
d81766
to migration section "i8254", and bumped its version to 2.
d81766
d81766
qemu v0.12.0 commit 5122b43 ported i8254 to VMState, and also bumped
d81766
section version to 2.  Version 2 now means different things in qemu
d81766
and qemu-kvm.
d81766
d81766
This got merged into qemu-kvm-0.12.0 in commit f4f2edc.  The merge
d81766
added migration of flags to qemu's code.  Yet another version of
d81766
version 2.  This is what we got in RHEL-6.
d81766
d81766
qemu v1.1.0 commit ce967e2 added PITState member irq_disabled,
d81766
included it in migration section "i8254", and bumped its version to 3.
d81766
Because qemu's irq_disabled is compatible with qemu-kvm's flags,
d81766
qemu's version 3 is migration compatible with the latest instance of
d81766
qemu-kvm's version 2.
d81766
d81766
When this got merged into qemu-kvm-1.1.0, it changed qemu-kvm's
d81766
version 2 to no longer include flags / irq_disabled.  Commit 81bdec9
d81766
reverted the change of version 2.
d81766
d81766
We need to do the same to enable incoming migration from RHEL-6.
d81766
d81766
Signed-off-by: Markus Armbruster <armbru@redhat.com>
d81766
d81766
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
d81766
index 07345f6..649c7ee 100644
d81766
--- a/hw/timer/i8254_common.c
d81766
+++ b/hw/timer/i8254_common.c
d81766
@@ -266,7 +266,7 @@ static const VMStateDescription vmstate_pit_common = {
d81766
     .pre_save = pit_dispatch_pre_save,
d81766
     .post_load = pit_dispatch_post_load,
d81766
     .fields = (VMStateField[]) {
d81766
-        VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
d81766
+        VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */
d81766
         VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
d81766
                              vmstate_pit_channel, PITChannelState),
d81766
         VMSTATE_INT64(channels[0].next_transition_time,