[libvirt] [PATCH v2 01/11] qemu: make qemuComparePCIDevice aware of multiple buses

Eric Blake eblake at redhat.com
Wed Apr 17 21:07:26 UTC 2013


On 04/17/2013 01:00 PM, Ján Tomko wrote:
> 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 | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

ACK.

> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index a6c75cb..fb78af3 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;
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130417/7e632b05/attachment-0001.sig>


More information about the libvir-list mailing list