]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
pcie_sriov: Check PCI Express for SR-IOV PF
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Mon, 15 Jul 2024 05:19:10 +0000 (14:19 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 23 Jul 2024 00:15:41 +0000 (20:15 -0400)
SR-IOV requires PCI Express.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20240715-sriov-v5-4-3f5539093ffc@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie_sriov.c

index 6c79658b4c7ba4f44ffa3149cbba6cd939390a09..15a4aac1f4bc416b0506dd32d17d747d72eabeec 100644 (file)
@@ -42,6 +42,11 @@ bool pcie_sriov_pf_init(PCIDevice *dev, uint16_t offset,
     uint8_t *cfg = dev->config + offset;
     uint8_t *wmask;
 
+    if (!pci_is_express(dev)) {
+        error_setg(errp, "PCI Express is required for SR-IOV PF");
+        return false;
+    }
+
     if (pci_is_vf(dev)) {
         error_setg(errp, "a device cannot be both an SR-IOV PF and a VF");
         return false;