On 10/28/26 20:34, Daniel Paziyski wrote:
Hello Michael,

I think you have queued this patch for pulling on accident. There is a bug here,
which is yet to be solved, as you have pointed out in

https://lore.kernel.org/qemu-devel/[email protected]/T/#mca344ac148a62107cdc298e97e6713b6657b5c55

Please, hold off this patch for a while, until I come up with a fix soon.
Am I right this buggy version of the patch has just landed in the master branch,
instead of the fixed v2 one?

Here's the difference between what's in current master and the v2:

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index d4187293b1f..6242204a52c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2310,10 +2310,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error 
**errp)
         pci_dev->cap_present |= QEMU_PCIE_CAP_CXL;
     }

-    pci_dev = do_pci_register_device(pci_dev,
-                                     object_get_typename(OBJECT(qdev)),
-                                     pci_dev->devfn, errp);
-    if (pci_dev == NULL) {
+    if (!do_pci_register_device(pci_dev, object_get_typename(OBJECT(qdev)),
+                                pci_dev->devfn, errp)) {
         pci_unregister_acpi_index(pci_dev);
         return;
     }
@@ -2332,6 +2330,11 @@ static void pci_qdev_realize(DeviceState *qdev, Error 
**errp)
         }
     }

+    if (!pcie_sriov_check_after_realize(pci_dev, errp)) {
+        pci_qdev_unrealize(DEVICE(pci_dev));
+        return;
+    }
+
     /*
      * A PCIe Downstream Port that do not have ARI Forwarding enabled must
      * associate only Device 0 with the device attached to the bus
~

Thanks,

/mjt

Reply via email to