From ad003b9e6872c67836133066e1dd0f13458a9370 Mon Sep 17 00:00:00 2001 From: Zhenzhong Duan Date: Wed, 23 Feb 2022 17:44:35 +0800 Subject: [PATCH] pci: show id info when pci BDF conflict During qemu init stage, when there is pci BDF conflicts, qemu print a warning but not showing which device the BDF is occupied by. E.x: "PCI: slot 2 function 0 not available for virtio-scsi-pci, in use by virtio-scsi-pci" To facilitate user knowing the offending device and fixing it, showing the id info in the warning. Signed-off-by: Zhenzhong Duan Message-Id: <20220223094435.64495-1-zhenzhong.duan@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index ba8fb92efc..5cb1232e27 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1099,9 +1099,9 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, return NULL; } else if (!pci_bus_devfn_available(bus, devfn)) { error_setg(errp, "PCI: slot %d function %d not available for %s," - " in use by %s", + " in use by %s,id=%s", PCI_SLOT(devfn), PCI_FUNC(devfn), name, - bus->devices[devfn]->name); + bus->devices[devfn]->name, bus->devices[devfn]->qdev.id); return NULL; } else if (dev->hotplugged && !pci_is_vf(pci_dev) &&