From: Laine Stump Date: Mon, 12 Oct 2020 18:58:26 +0000 (-0400) Subject: util: don't use virPCIGetSysfsFile() X-Git-Tag: v6.9.0-rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dc39a204a449503428804f8bda9f9e2a6b96fa6;p=thirdparty%2Flibvirt.git util: don't use virPCIGetSysfsFile() virPCIDeviceAddressGetSysfsFile() is simpler to call. Signed-off-by: Laine Stump Reviewed-by: Erik Skultety Reviewed-by: Peter Krempa --- diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index d06d003e9b..91b12fc131 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1212,13 +1212,10 @@ 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) { virReportSystemError(ENOSYS, "%s", _("Failed to get PCI SYSFS file")); goto cleanup;