On Fri, 2015-04-17 at 12:59 -0400, Boris Ostrovsky wrote:
> +int libxl__pci_numdevs(libxl__gc *gc)
> +{
> +    DIR *dir;
> +    struct dirent *entry;
> +    int num_devs = 0;
> +
> +    dir = opendir("/sys/bus/pci/devices");
> +    if (!dir) {
> +        LOGEV(ERROR, errno, "Cannot open /sys/bus/pci/devices");

LOGEV is only useful if you want to log an errnoval which isn't actually
in errno, so here you could just use LOGE.

> +    dir = opendir("/sys/bus/pci/devices");
> +    if (!dir) {
> +        LOGEV(ERROR, errno, "Cannot open /sys/bus/pci/devices");

And again.
[...]
> +        if (sscanf(entry->d_name, "%x:%x:%x.%d", &dom, &bus, &dev, &func) < 
> 4) {
> +            LOGEV(ERROR, errno, "Error processing /sys/bus/pci/devices");

Again.

With all those fixed: Acked-by: Ian Campbell <ian.campb...@citrix.com>

Ian



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to