hw/ppc/spapr_pci: Do not create DT for disabled PCI device
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 27 Jun 2024 06:07:51 +0000 (15:07 +0900)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Jul 2024 22:14:07 +0000 (18:14 -0400)
Disabled means it is a disabled SR-IOV VF or it is powered off, and
hidden from the guest.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20240627-reuse-v10-2-7ca0b8ed3d9f@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/ppc/spapr_pci.c

index 7cf9904c3546ed6bd43b744473d3bd5d8900cd74..f63182a03c41c40d792ac6a41977dd50f9582e91 100644 (file)
@@ -1296,6 +1296,10 @@ static void spapr_dt_pci_device_cb(PCIBus *bus, PCIDevice *pdev,
         return;
     }
 
+    if (!pdev->enabled) {
+        return;
+    }
+
     err = spapr_dt_pci_device(p->sphb, pdev, p->fdt, p->offset);
     if (err < 0) {
         p->err = err;