From: Ján Tomko Date: Wed, 3 Apr 2013 16:09:47 +0000 (+0200) Subject: qemu: make qemuComparePCIDevice aware of multiple buses X-Git-Tag: v1.0.5-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e5928de98c7494442842085af3239f4d5730b17;p=thirdparty%2Flibvirt.git qemu: make qemuComparePCIDevice aware of multiple buses Bus and domain need to be checked as well, otherwise we might get false positives when searching for multi-function devices. --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4f39ca4c30..238d0d7b26 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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;