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

Laine Stump laine at redhat.com
Wed Oct 21 02:26:08 UTC 2020


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) {
             virReportSystemError(ENOSYS, "%s",
                                  _("Failed to get PCI SYSFS file"));
             goto cleanup;
-- 
2.26.2




More information about the libvir-list mailing list