Blame 0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch

1c3066
From 271e4d924c39efd716cc3ad86a5f615660b13f22 Mon Sep 17 00:00:00 2001
96a5f8
From: Cole Robinson <crobinso@redhat.com>
96a5f8
Date: Tue, 19 Feb 2013 15:35:40 -0500
96a5f8
Subject: [PATCH] pc_piix: Add compat handling for qemu-kvm VGA mem size
96a5f8
96a5f8
Paolo outlines this here:
96a5f8
96a5f8
https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg02540.html
96a5f8
96a5f8
qemu-kvm defaulted to vgamem=16MB since at least 0.15, while qemu used
96a5f8
8MB. For qemu 1.2, the default was changed to 16MB for all devices
96a5f8
except cirrus.
96a5f8
96a5f8
If --enable-migration-from-qemu-kvm is specified, make sure cirrus
96a5f8
uses 16MB for <= pc-1.2 (the qemu-kvm merge), and 16MB always for
96a5f8
all others. This will break incoming qemu migration for qemu < 1.3.
96a5f8
96a5f8
Signed-off-by: Cole Robinson <crobinso@redhat.com>
96a5f8
---
96a5f8
 hw/pc_piix.c | 20 ++++++++++++++++----
96a5f8
 1 file changed, 16 insertions(+), 4 deletions(-)
96a5f8
96a5f8
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
96a5f8
index 0af436c..e3f8e96 100644
96a5f8
--- a/hw/pc_piix.c
96a5f8
+++ b/hw/pc_piix.c
96a5f8
@@ -331,6 +331,13 @@ static QEMUMachine pc_machine_v1_3 = {
96a5f8
     DEFAULT_MACHINE_OPTIONS,
96a5f8
 };
96a5f8
 
96a5f8
+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
96a5f8
+/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */
96a5f8
+# define OLD_VGA_MEM stringify(16)
96a5f8
+#else
96a5f8
+# define OLD_VGA_MEM stringify(8)
96a5f8
+#endif
96a5f8
+
96a5f8
 #define PC_COMPAT_1_2 \
96a5f8
         PC_COMPAT_1_3,\
96a5f8
         {\
96a5f8
@@ -354,6 +361,10 @@ static QEMUMachine pc_machine_v1_3 = {
96a5f8
             .property = "revision",\
96a5f8
             .value    = stringify(3),\
96a5f8
         },{\
96a5f8
+            .driver   = "cirrus-vga",\
96a5f8
+            .property = "vgamem_mb",\
96a5f8
+            .value    = OLD_VGA_MEM,\
96a5f8
+        },{\
96a5f8
             .driver   = "VGA",\
96a5f8
             .property = "mmio",\
96a5f8
             .value    = "off",\
96a5f8
@@ -371,6 +382,7 @@ static QEMUMachine pc_machine_v1_2 = {
96a5f8
     DEFAULT_MACHINE_OPTIONS,
96a5f8
 };
96a5f8
 
96a5f8
+
96a5f8
 #define PC_COMPAT_1_1 \
96a5f8
         PC_COMPAT_1_2,\
96a5f8
         {\
96a5f8
@@ -384,19 +396,19 @@ static QEMUMachine pc_machine_v1_2 = {
96a5f8
         },{\
96a5f8
             .driver   = "VGA",\
96a5f8
             .property = "vgamem_mb",\
96a5f8
-            .value    = stringify(8),\
96a5f8
+            .value    = OLD_VGA_MEM,\
96a5f8
         },{\
96a5f8
             .driver   = "vmware-svga",\
96a5f8
             .property = "vgamem_mb",\
96a5f8
-            .value    = stringify(8),\
96a5f8
+            .value    = OLD_VGA_MEM,\
96a5f8
         },{\
96a5f8
             .driver   = "qxl-vga",\
96a5f8
             .property = "vgamem_mb",\
96a5f8
-            .value    = stringify(8),\
96a5f8
+            .value    = OLD_VGA_MEM,\
96a5f8
         },{\
96a5f8
             .driver   = "qxl",\
96a5f8
             .property = "vgamem_mb",\
96a5f8
-            .value    = stringify(8),\
96a5f8
+            .value    = OLD_VGA_MEM,\
96a5f8
         },{\
96a5f8
             .driver   = "virtio-blk-pci",\
96a5f8
             .property = "config-wce",\