]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: make qemuComparePCIDevice aware of multiple buses
authorJán Tomko <jtomko@redhat.com>
Wed, 3 Apr 2013 16:09:47 +0000 (18:09 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 19 Apr 2013 15:50:54 +0000 (17:50 +0200)
Bus and domain need to be checked as well, otherwise we might
get false positives when searching for multi-function devices.

src/qemu/qemu_hotplug.c

index 4f39ca4c302b82e4f1ece3d1a782946e133dc3a2..238d0d7b26034fe8c5d0c6877cda0fc3054ba503 100644 (file)
@@ -1999,7 +1999,9 @@ static int qemuComparePCIDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
         info2->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
         return 0;
 
-    if (info1->addr.pci.slot == info2->addr.pci.slot &&
+    if (info1->addr.pci.domain == info2->addr.pci.domain &&
+        info1->addr.pci.bus == info2->addr.pci.bus &&
+        info1->addr.pci.slot == info2->addr.pci.slot &&
         info1->addr.pci.function != info2->addr.pci.function)
         return -1;
     return 0;