cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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