mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
interface_backend_udev: refactor udevListInterfacesByStatus
Commit <2f3b7a5555c4cf4127ff3f8e00746eafcc91432c> replaced VIR_STRDUP by g_strdup which made the error: path mostly useless. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
2b58ce9155
commit
0e7549fe47
@ -204,7 +204,8 @@ udevListInterfacesByStatus(virConnectPtr conn,
|
|||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to get list of %s interfaces on host"),
|
_("failed to get list of %s interfaces on host"),
|
||||||
virUdevStatusString(status));
|
virUdevStatusString(status));
|
||||||
goto error;
|
udev_unref(udev);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do the scan to load up the enumeration */
|
/* Do the scan to load up the enumeration */
|
||||||
@ -239,16 +240,6 @@ udevListInterfacesByStatus(virConnectPtr conn,
|
|||||||
udev_unref(udev);
|
udev_unref(udev);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
||||||
error:
|
|
||||||
if (enumerate)
|
|
||||||
udev_enumerate_unref(enumerate);
|
|
||||||
udev_unref(udev);
|
|
||||||
|
|
||||||
for (names_len = 0; names_len < count; names_len++)
|
|
||||||
VIR_FREE(names[names_len]);
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user