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

7fae7f
From 3e580f65ac69c7a84b672a59de6772dae24b5a8a 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
---
7fae7f
 hw/i386/pc_piix.c | 20 ++++++++++++++++----
96a5f8
 1 file changed, 16 insertions(+), 4 deletions(-)
96a5f8
7fae7f
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
7fae7f
index 43ab480..48fb7b7 100644
7fae7f
--- a/hw/i386/pc_piix.c
7fae7f
+++ b/hw/i386/pc_piix.c
7fae7f
@@ -383,6 +383,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
         {\
7fae7f
@@ -406,6 +413,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",\
7fae7f
@@ -423,6 +434,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
         {\
7fae7f
@@ -436,19 +448,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",\