[RFC PATCH 35/43] qemu_domain_address: Drop compatibility with pre-device vga specification for q35

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove the slot reservation for the vga card which doesn't make sense
with supported qemus any more for the q35 machine type.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain_address.c | 40 ++++------------------------------
 1 file changed, 4 insertions(+), 36 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 85a6136325..308b23676d 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1841,12 +1841,10 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,

 static int
 qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
-                                    virQEMUCapsPtr qemuCaps,
                                     virDomainPCIAddressSetPtr addrs)
 {
     size_t i;
     virPCIDeviceAddress tmp_addr;
-    bool qemuDeviceVideoUsable = virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
     g_autofree char *addrStr = NULL;
     virDomainPCIConnectFlags flags = VIR_PCI_CONNECT_TYPE_PCIE_DEVICE;

@@ -1979,45 +1977,15 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,
                 return -1;

             if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
-                if (qemuDeviceVideoUsable) {
-                    if (qemuDomainPCIAddressReserveNextAddr(addrs,
-                                                            &primaryVideo->info) < 0)
-                        return -1;
-                } else {
-                    virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                                   _("PCI address 0:0:1.0 is in use, "
-                                     "QEMU needs it for primary video"));
+                if (qemuDomainPCIAddressReserveNextAddr(addrs,
+                                                        &primaryVideo->info) < 0)
                     return -1;
-                }
             } else {
                 if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0)
                     return -1;
                 primaryVideo->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI;
                 primaryVideo->info.addr.pci = tmp_addr;
             }
-        } else if (!qemuDeviceVideoUsable) {
-            if (primaryVideo->info.addr.pci.domain != 0 ||
-                primaryVideo->info.addr.pci.bus != 0 ||
-                primaryVideo->info.addr.pci.slot != 1 ||
-                primaryVideo->info.addr.pci.function != 0) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("Primary video card must have PCI address 0:0:1.0"));
-                return -1;
-            }
-            /* If TYPE == PCI, then qemuDomainCollectPCIAddress() function
-             * has already reserved the address, so we must skip */
-        }
-    } else if (addrs->nbuses && !qemuDeviceVideoUsable) {
-        memset(&tmp_addr, 0, sizeof(tmp_addr));
-        tmp_addr.slot = 1;
-
-        if (virDomainPCIAddressSlotInUse(addrs, &tmp_addr)) {
-            VIR_DEBUG("PCI address 0:0:1.0 in use, future addition of a video"
-                      " device will not be possible without manual"
-                      " intervention");
-            virResetLastError();
-        } else if (virDomainPCIAddressReserveAddr(addrs, &tmp_addr, flags, 0) < 0) {
-            return -1;
         }
     }

@@ -2052,7 +2020,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def,

 static int
 qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def,
-                                         virQEMUCapsPtr qemuCaps,
+                                         virQEMUCapsPtr qemuCaps G_GNUC_UNUSED,
                                          virDomainPCIAddressSetPtr addrs)
 {
     if (qemuDomainIsI440FX(def) &&
@@ -2061,7 +2029,7 @@ qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def,
     }

     if (qemuDomainIsQ35(def) &&
-        qemuDomainValidateDevicePCISlotsQ35(def, qemuCaps, addrs) < 0) {
+        qemuDomainValidateDevicePCISlotsQ35(def, addrs) < 0) {
         return -1;
     }

-- 
2.30.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux