]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/pci/pci.c
pci: fix error message for express slots
[mirror_qemu.git] / hw / pci / pci.c
index 24fae1689d507fa6c4ea82bdb33beee47bf8589e..637d54549e410dc0b6c53d44449ad362d7b3b004 100644 (file)
@@ -982,8 +982,8 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
                pci_get_function_0(pci_dev)) {
         error_setg(errp, "PCI: slot %d function 0 already ocuppied by %s,"
                    " new func %s cannot be exposed to guest.",
-                   PCI_SLOT(devfn),
-                   bus->devices[PCI_DEVFN(PCI_SLOT(devfn), 0)]->name,
+                   PCI_SLOT(pci_get_function_0(pci_dev)->devfn),
+                   pci_get_function_0(pci_dev)->name,
                    name);
 
        return NULL;