diff mbox

[4/4] pc_piix: Add compat handling for qemu-kvm VGA mem size

Message ID d936a00b0edc2f927b745d9e3e105be52beaea06.1361313340.git.crobinso@redhat.com
State New
Headers show

Commit Message

Cole Robinson Feb. 19, 2013, 10:40 p.m. UTC
Paolo outlines this here:

https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg02540.html

qemu-kvm defaulted to vgamem=16MB since at least 0.15, while qemu used
8MB. For qemu 1.2, the default was changed to 16MB for all devices
except cirrus.

If --enable-migration-from-qemu-kvm is specified, make sure cirrus
uses 16MB for <= pc-1.2 (the qemu-kvm merge), and 16MB always for
all others. This will break incoming qemu migration for qemu < 1.3.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 hw/pc_piix.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Comments

Paolo Bonzini Feb. 19, 2013, 10:52 p.m. UTC | #1
Il 19/02/2013 23:40, Cole Robinson ha scritto:
> +#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
> +/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */
> +# define OLD_VGA_MEM stringify(16)
> +#else
> +# define OLD_VGA_MEM stringify(8)
> +#endif
> +
>  #define PC_COMPAT_1_2 \
>          PC_COMPAT_1_3,\
>          {\
> @@ -354,6 +361,10 @@ static QEMUMachine pc_machine_v1_3 = {
>              .property = "revision",\
>              .value    = stringify(3),\
>          },{\
> +            .driver   = "cirrus-vga",\
> +            .property = "vgamem_mb",\
> +            .value    = OLD_VGA_MEM,\
> +        },{\
>              .driver   = "VGA",\
>              .property = "mmio",\
>              .value    = "off",\

Because this is now 1.5, you also need to define pc_machine_v1_4 and add
the compat property there.

Also, please add the "Cc: qemu-stable@nongnu.org" in the body of the
message.  It's an easy way for maintainers to pick up patches only after
they've been committed.

Paolo
Cole Robinson Feb. 19, 2013, 10:59 p.m. UTC | #2
On 02/19/2013 05:52 PM, Paolo Bonzini wrote:
> Il 19/02/2013 23:40, Cole Robinson ha scritto:
>> +#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
>> +/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */
>> +# define OLD_VGA_MEM stringify(16)
>> +#else
>> +# define OLD_VGA_MEM stringify(8)
>> +#endif
>> +
>>  #define PC_COMPAT_1_2 \
>>          PC_COMPAT_1_3,\
>>          {\
>> @@ -354,6 +361,10 @@ static QEMUMachine pc_machine_v1_3 = {
>>              .property = "revision",\
>>              .value    = stringify(3),\
>>          },{\
>> +            .driver   = "cirrus-vga",\
>> +            .property = "vgamem_mb",\
>> +            .value    = OLD_VGA_MEM,\
>> +        },{\
>>              .driver   = "VGA",\
>>              .property = "mmio",\
>>              .value    = "off",\
> 
> Because this is now 1.5, you also need to define pc_machine_v1_4 and add
> the compat property there.
> 

I'm confused, pc-1.4 cirrus has vgamem_mb=8, and we want it that way
regardless of whether --enable-migration-from-qemu-kvm is specified.

(this patch doesn't change the default cirrus memory as you suggested in the
referenced mail)

> Also, please add the "Cc: qemu-stable@nongnu.org" in the body of the
> message.  It's an easy way for maintainers to pick up patches only after
> they've been committed.
> 

Will do if/when reposting.

Thanks,
Cole
Paolo Bonzini Feb. 19, 2013, 11:07 p.m. UTC | #3
Il 19/02/2013 23:59, Cole Robinson ha scritto:
> On 02/19/2013 05:52 PM, Paolo Bonzini wrote:
>> Il 19/02/2013 23:40, Cole Robinson ha scritto:
>>> +#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
>>> +/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */
>>> +# define OLD_VGA_MEM stringify(16)
>>> +#else
>>> +# define OLD_VGA_MEM stringify(8)
>>> +#endif
>>> +
>>>  #define PC_COMPAT_1_2 \
>>>          PC_COMPAT_1_3,\
>>>          {\
>>> @@ -354,6 +361,10 @@ static QEMUMachine pc_machine_v1_3 = {
>>>              .property = "revision",\
>>>              .value    = stringify(3),\
>>>          },{\
>>> +            .driver   = "cirrus-vga",\
>>> +            .property = "vgamem_mb",\
>>> +            .value    = OLD_VGA_MEM,\
>>> +        },{\
>>>              .driver   = "VGA",\
>>>              .property = "mmio",\
>>>              .value    = "off",\
>>
>> Because this is now 1.5, you also need to define pc_machine_v1_4 and add
>> the compat property there.
> 
> I'm confused, pc-1.4 cirrus has vgamem_mb=8, and we want it that way
> regardless of whether --enable-migration-from-qemu-kvm is specified.
> 
> (this patch doesn't change the default cirrus memory as you suggested in the
> referenced mail)

Yes, that's it.  Better go to bed.  That would be a separate patch that
wouldn't have to be Cc-ed to stable.

Paolo

>> Also, please add the "Cc: qemu-stable@nongnu.org" in the body of the
>> message.  It's an easy way for maintainers to pick up patches only after
>> they've been committed.
>>
> 
> Will do if/when reposting.
> 
> Thanks,
> Cole
> 
>
diff mbox

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 0af436c..e3f8e96 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -331,6 +331,13 @@  static QEMUMachine pc_machine_v1_3 = {
     DEFAULT_MACHINE_OPTIONS,
 };
 
+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM
+/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */
+# define OLD_VGA_MEM stringify(16)
+#else
+# define OLD_VGA_MEM stringify(8)
+#endif
+
 #define PC_COMPAT_1_2 \
         PC_COMPAT_1_3,\
         {\
@@ -354,6 +361,10 @@  static QEMUMachine pc_machine_v1_3 = {
             .property = "revision",\
             .value    = stringify(3),\
         },{\
+            .driver   = "cirrus-vga",\
+            .property = "vgamem_mb",\
+            .value    = OLD_VGA_MEM,\
+        },{\
             .driver   = "VGA",\
             .property = "mmio",\
             .value    = "off",\
@@ -371,6 +382,7 @@  static QEMUMachine pc_machine_v1_2 = {
     DEFAULT_MACHINE_OPTIONS,
 };
 
+
 #define PC_COMPAT_1_1 \
         PC_COMPAT_1_2,\
         {\
@@ -384,19 +396,19 @@  static QEMUMachine pc_machine_v1_2 = {
         },{\
             .driver   = "VGA",\
             .property = "vgamem_mb",\
-            .value    = stringify(8),\
+            .value    = OLD_VGA_MEM,\
         },{\
             .driver   = "vmware-svga",\
             .property = "vgamem_mb",\
-            .value    = stringify(8),\
+            .value    = OLD_VGA_MEM,\
         },{\
             .driver   = "qxl-vga",\
             .property = "vgamem_mb",\
-            .value    = stringify(8),\
+            .value    = OLD_VGA_MEM,\
         },{\
             .driver   = "qxl",\
             .property = "vgamem_mb",\
-            .value    = stringify(8),\
+            .value    = OLD_VGA_MEM,\
         },{\
             .driver   = "virtio-blk-pci",\
             .property = "config-wce",\