vgabios update: handle compatibility with older qemu versions
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 17 Nov 2010 11:06:44 +0000 (12:06 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Sun, 21 Nov 2010 15:16:57 +0000 (09:16 -0600)
As pointed out by avi the vgabios update is guest-visible and thus has
migration implications.

One change is that the vga has a valid pci rom bar now.  We already have
a pci bus property to enable/disable the rom bar and we'll load the bios
via fw_cfg as fallback for the no-rom-bar case.  So we just have to add
compat properties to handle this case.

A second change is that the magic bochs lfb @ 0xe0000000 is gone.  When
live-migrating a guest from a older qemu version it might be using the
lfb though, so we have to keep it for the old machine types.  The patch
enables the bochs lfb in case we don't have the pci rom bar enabled
(i.e. we are in 0.13+older compat mode).

This patch depends on these patches which add (and use) the pc-0.13
machine type:
  http://patchwork.ozlabs.org/patch/70797/
  http://patchwork.ozlabs.org/patch/70798/

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: avi@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pc_piix.c
hw/vga-pci.c
hw/vmware_vga.c

index 31c80d273b2c836b8c7f1885d13283fa80e1596c..7d29d4319014cbdbf3ff740bf4c280fd03ef0fc9 100644 (file)
@@ -230,6 +230,14 @@ static QEMUMachine pc_machine_v0_13 = {
             .driver   = "virtio-9p-pci",
             .property = "vectors",
             .value    = stringify(0),
+        },{
+            .driver   = "VGA",
+            .property = "rombar",
+            .value    = stringify(0),
+        },{
+            .driver   = "vmware-svga",
+            .property = "rombar",
+            .value    = stringify(0),
         },
         { /* end of list */ }
     },
@@ -249,6 +257,14 @@ static QEMUMachine pc_machine_v0_12 = {
             .driver   = "virtio-serial-pci",
             .property = "vectors",
             .value    = stringify(0),
+        },{
+            .driver   = "VGA",
+            .property = "rombar",
+            .value    = stringify(0),
+        },{
+            .driver   = "vmware-svga",
+            .property = "rombar",
+            .value    = stringify(0),
         },
         { /* end of list */ }
     }
index b09789cd11fd948c35a654b36bb80af972047170..791ca22763eec9896b476ee2bfb05b4d230019c3 100644 (file)
@@ -92,6 +92,11 @@ static int pci_vga_initfn(PCIDevice *dev)
      pci_register_bar(&d->dev, 0, VGA_RAM_SIZE,
                       PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map);
 
+     if (!dev->rom_bar) {
+         /* compatibility with pc-0.13 and older */
+         vga_init_vbe(s);
+     }
+
      return 0;
 }
 
index 9337fdbfef87f5c0306d3241601f990ef076ad77..d0f4e1b5b57dabd56ccaac8a37479698a504c1e7 100644 (file)
@@ -1301,6 +1301,11 @@ static int pci_vmsvga_initfn(PCIDevice *dev)
 
     vmsvga_init(&s->chip, VGA_RAM_SIZE);
 
+    if (!dev->rom_bar) {
+        /* compatibility with pc-0.13 and older */
+        vga_init_vbe(&s->chip.vga);
+    }
+
     return 0;
 }