提交 4c4ff7a1 编写于 作者: M Marc Hartmayer 提交者: John Ferlan

udev: only report a warning if udev_enumerate_scan_devices fails

Even if an error is reported by `udev_enumerate_scan_devices`,
e.g. because a driver of a device has an bug, we can still enumerate
all other devices. Additionally the documentation of
udev_enumerate_scan_devices says that on success an integer >= 0 is
returned (see man udev_enumerate_scan_devices(3)).
Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: NMarc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 0f110d5a
......@@ -1480,13 +1480,8 @@ udevEnumerateDevices(struct udev *udev)
if (udevEnumerateAddMatches(udev_enumerate) < 0)
goto cleanup;
ret = udev_enumerate_scan_devices(udev_enumerate);
if (ret != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("udev scan devices returned %d"),
ret);
goto cleanup;
}
if (udev_enumerate_scan_devices(udev_enumerate) < 0)
VIR_WARN("udev scan devices failed");
udev_list_entry_foreach(list_entry,
udev_enumerate_get_list_entry(udev_enumerate)) {
......@@ -1494,6 +1489,7 @@ udevEnumerateDevices(struct udev *udev)
udevProcessDeviceListEntry(udev, list_entry);
}
ret = 0;
cleanup:
udev_enumerate_unref(udev_enumerate);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册