return 0;
}
-static int is_assigned(libxl_device_pci *assigned, int num_assigned,
+static int is_pcidev_in_array(libxl_device_pci *assigned, int num_assigned,
int dom, int bus, int dev, int func)
{
int i;
if ( sscanf(de->d_name, PCI_BDF, &dom, &bus, &dev, &func) != 4 )
continue;
- if ( is_assigned(assigned, num_assigned, dom, bus, dev, func) )
+ if ( is_pcidev_in_array(assigned, num_assigned, dom, bus, dev, func) )
continue;
new = realloc(pcidevs, ((*num) + 1) * sizeof(*new));
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
goto out;
}
- if ( is_assigned(assigned, num_assigned, pcidev->domain,
+ if ( is_pcidev_in_array(assigned, num_assigned, pcidev->domain,
pcidev->bus, pcidev->dev, pcidev->func) ) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device already attached to a domain");
rc = ERROR_FAIL;
return ERROR_FAIL;
rc = ERROR_INVAL;
- if ( !is_assigned(assigned, num, pcidev->domain,
+ if ( !is_pcidev_in_array(assigned, num, pcidev->domain,
pcidev->bus, pcidev->dev, pcidev->func) ) {
LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device not attached to this domain");
goto out_fail;