Re: [libvirt] [PATCH 2/6] Add helper APIs for iterating over PCI device resource files

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

 



On Tue, Sep 01, 2009 at 04:28:55PM +0100, Daniel P. Berrange wrote:
[...]
> @@ -1022,3 +1022,55 @@ pciDeviceListFind(pciDeviceList *list, pciDevice *dev)
>              return list->devs[i];
>      return NULL;
>  }
> +
> +
> +int pciDeviceFileIterate(virConnectPtr conn,
> +                         pciDevice *dev,
> +                         pciDeviceFileActor actor,
> +                         void *opaque)
> +{
> +    char *pcidir = NULL;
> +    char *file = NULL;
> +    DIR *dir = NULL;
> +    int ret = -1;
> +    struct dirent *ent;
> +
> +    if (virAsprintf(&pcidir, "/sys/bus/pci/devices/%04x:%02x:%02x.%x",
> +                    dev->domain, dev->bus, dev->slot, dev->function) < 0) {

  hum "%s/devices/%04x:%02x:%02x.%x ", PCI_SYSFS, ...
would be a bit better I guess

   Fine, ACK,

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]