Re: [libvirt] [PATCH 01/15] Make pciDeviceList struct opaque

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 03, 2009 at 02:49:55PM -0500, Daniel P. Berrange wrote:
> * src/util/pci.c, src/util/pci.h: Make the pciDeviceList struct
>   opaque to callers of the API. Add accessor methods for managing
>   devices in the list
> * src/qemu/qemu_driver.c: Update to use APIs instead of directly
>   accessing pciDeviceList fields

  Sounds good !

>  
[...]
> @@ -1417,33 +1419,39 @@ qemuPrepareHostDevices(virConnectPtr conn,
>       * to pci-stub.ko
>       */
>  
> -    for (i = 0; i < pcidevs->count; i++)
> -        if (pciDeviceGetManaged(pcidevs->devs[i]) &&
> -            pciDettachDevice(conn, pcidevs->devs[i]) < 0)
> -            goto error;
> +    for (i = 0; i < pciDeviceListCount(pcidevs); i++) {
> +        pciDevice *dev = pciDeviceListGet(pcidevs, i);
> +        if (pciDeviceGetManaged(dev) &&
> +            pciDettachDevice(conn, dev) < 0)
> +            goto cleanup;
> +    }

  I wasn't sure at first but since pciDeviceGetManaged() only error is
to return NULL then okay


  ACK, looks fine !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]