mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 02:15:23 +00:00
Allow devices without a parent
* Allow devices without parent links to be created and set their parent to the root "computer" node
This commit is contained in:
parent
3b04f3bb0f
commit
e29439bd14
@ -1220,14 +1220,13 @@ static int udevSetParent(struct udev_device *device,
|
|||||||
if (parent_device == NULL) {
|
if (parent_device == NULL) {
|
||||||
VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
|
VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
|
||||||
udev_device_get_syspath(device));
|
udev_device_get_syspath(device));
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parent_sysfs_path = udev_device_get_syspath(parent_device);
|
parent_sysfs_path = udev_device_get_syspath(parent_device);
|
||||||
if (parent_sysfs_path == NULL) {
|
if (parent_sysfs_path == NULL) {
|
||||||
VIR_INFO("Could not get syspath for parent of '%s'",
|
VIR_INFO("Could not get syspath for parent of '%s'",
|
||||||
udev_device_get_syspath(device));
|
udev_device_get_syspath(device));
|
||||||
goto out;
|
parent_sysfs_path = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
def->parent_sysfs_path = strdup(parent_sysfs_path);
|
def->parent_sysfs_path = strdup(parent_sysfs_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user