]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: assign PCI address to primary video card
authorVitor de Lima <vitor.lima@eldorado.org.br>
Wed, 6 Nov 2013 16:13:54 +0000 (14:13 -0200)
committerLaine Stump <laine@laine.org>
Fri, 8 Nov 2013 10:48:32 +0000 (12:48 +0200)
When adding support for Q35 guests, the code to assign a PCI address
to the primary video card was moved into Q35 and i440fx(PIIX3)
specific functions, but no fallback was kept for other machine types
that might have a video card.

This patch remedies that by assigning a PCI address to the primary
video card if it does not have any kind of address.  In particular,
this fixes issues with pseries guests.

Signed-off-by: Vitor de Lima <vitor.lima@eldorado.org.br>
Signed-off-by: Laine Stump <laine@laine.org>
src/qemu/qemu_command.c

index e8742f5c88a4ce40d409da3cbbbf06855ce8f1b4..1d693e1704c12507eb5e65d68081499754ff4f39 100644 (file)
@@ -2959,6 +2959,14 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
             goto error;
     }
 
+    /* Assign a PCI slot to the primary video card if there is not an
+     * assigned address. */
+    if (def->nvideos > 0 &&
+        def->videos[0]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
+        if (qemuDomainPCIAddressReserveNextSlot(addrs, &def->videos[0]->info,
+                                                flags) < 0)
+            goto error;
+    }
     /* Further non-primary video cards which have to be qxl type */
     for (i = 1; i < def->nvideos; i++) {
         if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {