76daa3
From d2aba8a17b40c081f2ce29bc12b3945b7fb91d53 Mon Sep 17 00:00:00 2001
76daa3
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
76daa3
Date: Thu, 25 Jun 2015 16:34:25 +0200
76daa3
Subject: Migration compat for pckbd
76daa3
76daa3
Patchwork-id: 66497
76daa3
O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH 1/1] Migration compat for pckbd
76daa3
Bugzilla: 1215092
76daa3
RH-Acked-by: Juan Quintela <quintela@redhat.com>
76daa3
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
76daa3
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
76daa3
76daa3
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
76daa3
76daa3
2.2 added a new subsection to the pc keyboard model to preserve
76daa3
the value of 'outport' across migration; to maintain migration
76daa3
backwards compatibility this patch disables it on older machine types.
76daa3
This leaves us no-worse-off than in older versions.
76daa3
76daa3
Even with the new code, the value migrated in 'outport' isn't used
76daa3
anywhere in the pckbd model; for example the value migrated doesn't
76daa3
change the state of the A20 line or potentially do a reset.
76daa3
76daa3
The only effect, as far as I can tell is if the guest were to
76daa3
explicitly read the outport value it might get a more sensible reply.
76daa3
76daa3
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
76daa3
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
(cherry picked from commit 203b3380ba20f9836f00745141a69a91c646039e)
76daa3
(cherry picked from commit 52ca66b68e09415470425f07e93940407aeb805d)
76daa3
---
76daa3
 hw/input/pckbd.c | 6 ++++++
76daa3
 1 file changed, 6 insertions(+)
76daa3
76daa3
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
76daa3
index 78b6c01..f475f33 100644
76daa3
--- a/hw/input/pckbd.c
76daa3
+++ b/hw/input/pckbd.c
76daa3
@@ -26,6 +26,7 @@
76daa3
 #include "hw/isa/isa.h"
76daa3
 #include "hw/i386/pc.h"
76daa3
 #include "hw/input/ps2.h"
76daa3
+#include "migration/migration.h"
76daa3
 #include "sysemu/sysemu.h"
76daa3
 
76daa3
 /* debug PC keyboard */
76daa3
@@ -389,6 +390,11 @@ static int kbd_outport_post_load(void *opaque, int version_id)
76daa3
 static bool kbd_outport_needed(void *opaque)
76daa3
 {
76daa3
     KBDState *s = opaque;
76daa3
+
76daa3
+    if (migrate_pre_2_2) {
76daa3
+        return false;
76daa3
+    }
76daa3
+
76daa3
     return s->outport != kbd_outport_default(s);
76daa3
 }
76daa3
 
76daa3
-- 
76daa3
1.8.3.1
76daa3