mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: don't use virPCIGetSysfsFile()
virPCIDeviceAddressGetSysfsFile() is simpler to call. Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
668dd10ba9
commit
4dc39a204a
@ -1212,13 +1212,10 @@ virNetDevGetVirtualFunctions(const char *pfname,
|
|||||||
*vfname = g_new0(char *, *n_vfname);
|
*vfname = g_new0(char *, *n_vfname);
|
||||||
|
|
||||||
for (i = 0; i < *n_vfname; i++) {
|
for (i = 0; i < *n_vfname; i++) {
|
||||||
g_autofree char *pciConfigAddr = NULL;
|
|
||||||
g_autofree char *pci_sysfs_device_link = NULL;
|
g_autofree char *pci_sysfs_device_link = NULL;
|
||||||
|
|
||||||
if (!(pciConfigAddr = virPCIDeviceAddressAsString((*virt_fns)[i])))
|
if (virPCIDeviceAddressGetSysfsFile((*virt_fns)[i],
|
||||||
goto cleanup;
|
&pci_sysfs_device_link) < 0) {
|
||||||
|
|
||||||
if (virPCIGetSysfsFile(pciConfigAddr, &pci_sysfs_device_link) < 0) {
|
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Failed to get PCI SYSFS file"));
|
_("Failed to get PCI SYSFS file"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user