diff options
author | Doug Magee <djmagee@mageenet.net> | 2012-01-24 15:36:19 +0000 |
---|---|---|
committer | Doug Magee <djmagee@mageenet.net> | 2012-01-24 15:36:19 +0000 |
commit | 92e33c0719d4dd063f308f8dcdb8f9eb31580124 (patch) | |
tree | 2b85c19e847e2015e6ee940a11b4202e633b2d80 /tools/libxl | |
parent | 4c20f820c1ff6d381bc11b31d47bf3580e2e2d6c (diff) | |
download | xen-92e33c0719d4dd063f308f8dcdb8f9eb31580124.tar.gz xen-92e33c0719d4dd063f308f8dcdb8f9eb31580124.tar.bz2 xen-92e33c0719d4dd063f308f8dcdb8f9eb31580124.zip |
libxl: rename is_assigned to is_pcidev_in_array
All this function does is check to see if a device is in an array of
pcidevs passed by the caller. The function name can be misleading if
ever used to check against a list of devices other than those assigned
to a domain.
Signed-off-by: Doug Magee <djmagee@mageenet.net>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl')
-rw-r--r-- | tools/libxl/libxl_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index c3828f6068..99591c27ee 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -447,7 +447,7 @@ static int get_all_assigned_devices(libxl__gc *gc, libxl_device_pci **list, int 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; @@ -496,7 +496,7 @@ libxl_device_pci *libxl_device_pci_list_assignable(libxl_ctx *ctx, int *num) 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)); @@ -788,7 +788,7 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide 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; @@ -892,7 +892,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, 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; |