[PATCH 8/9] util: don't use virPCIGetSysfsFile()

Erik Skultety eskultet at redhat.com
Wed Oct 21 08:41:09 UTC 2020


On Tue, Oct 20, 2020 at 10:26:08PM -0400, Laine Stump wrote:
> virPCIDeviceAddressGetSysfsFile() is simpler to call.
> 
> Signed-off-by: Laine Stump <laine at redhat.com>
> ---
>  src/util/virnetdev.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> index 088f35621d..e284d62233 100644
> --- a/src/util/virnetdev.c
> +++ b/src/util/virnetdev.c
> @@ -1212,13 +1212,9 @@ virNetDevGetVirtualFunctions(const char *pfname,
>      *vfname = g_new0(char *, *n_vfname);
>  
>      for (i = 0; i < *n_vfname; i++) {
> -        g_autofree char *pciConfigAddr = NULL;
>          g_autofree char *pci_sysfs_device_link = NULL;
>  
> -        if (!(pciConfigAddr = virPCIDeviceAddressAsString((*virt_fns)[i])))
> -            goto cleanup;
> -
> -        if (virPCIGetSysfsFile(pciConfigAddr, &pci_sysfs_device_link) < 0) {
> +        if (virPCIDeviceAddressGetSysfsFile((*virt_fns)[i], &pci_sysfs_device_link) < 0) {

                                                     new line ^here please
>              virReportSystemError(ENOSYS, "%s",
>                                   _("Failed to get PCI SYSFS file"));
>              goto cleanup;

Reviewed-by: Erik Skultety <eskultet at redhat.com>




More information about the libvir-list mailing list