thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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