[libvirt] [PATCH] pci: Use 'addr' instead of 'dev' for virPCIDeviceAddressPtr

Martin Kletzander mkletzan at redhat.com
Tue Dec 15 09:41:22 UTC 2015


On Tue, Dec 15, 2015 at 10:01:23AM +0100, Andrea Bolognani wrote:
>The name 'dev' is more appropriate for virPCIDevicePtr.
>---
> src/util/virpci.c | 7 ++++---
> src/util/virpci.h | 4 ++--
> 2 files changed, 6 insertions(+), 5 deletions(-)
>

ACK, trivial.

You could also fix the virPCIDeviceAddressGetIOMMUGroupNum() in the
header file, so it is the same as the .c file.

>diff --git a/src/util/virpci.c b/src/util/virpci.c
>index bb874ac..9cc4613 100644
>--- a/src/util/virpci.c
>+++ b/src/util/virpci.c
>@@ -2655,12 +2655,13 @@ virPCIGetSysfsFile(char *virPCIDeviceName, char **pci_sysfs_device_link)
> }
>
> int
>-virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr dev,
>+virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr,
>                                 char **pci_sysfs_device_link)
> {
>     if (virAsprintf(pci_sysfs_device_link,
>-                    PCI_SYSFS "devices/%04x:%02x:%02x.%x", dev->domain,
>-                    dev->bus, dev->slot, dev->function) < 0)
>+                    PCI_SYSFS "devices/%04x:%02x:%02x.%x",
>+                    addr->domain, addr->bus,
>+                    addr->slot, addr->function) < 0)
>         return -1;
>     return 0;
> }
>diff --git a/src/util/virpci.h b/src/util/virpci.h
>index 6516f05..f3d5676 100644
>--- a/src/util/virpci.h
>+++ b/src/util/virpci.h
>@@ -159,7 +159,7 @@ virPCIDeviceListPtr virPCIDeviceGetIOMMUGroupList(virPCIDevicePtr dev);
> int virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddressPtr devAddr,
>                                               virPCIDeviceAddressPtr **iommuGroupDevices,
>                                               size_t *nIommuGroupDevices);
>-int virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddressPtr dev);
>+int virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddressPtr addr);
> char *virPCIDeviceGetIOMMUGroupDev(virPCIDevicePtr dev);
>
> int virPCIDeviceIsAssignable(virPCIDevicePtr dev,
>@@ -180,7 +180,7 @@ int virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link,
>                                         const char *vf_sysfs_device_link,
>                                         int *vf_index);
>
>-int virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr dev,
>+int virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr,
>                                     char **pci_sysfs_device_link);
>
> int virPCIGetNetName(char *device_link_sysfs_path, char **netname);
>--
>2.5.0
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151215/0ef4295c/attachment-0001.sig>


More information about the libvir-list mailing list