[libvirt] [PATCH] Include sysfs devices lacking a device symlink as node devices

Ed Swierk eswierk at aristanetworks.com
Wed Mar 3 22:58:59 UTC 2010

The udev node device driver relies on the "device" symlink in sysfs to
populate the node device's parent property.  Loopback, vlan and bridge
network interfaces don't have a real hardware parent but could be useful
to include as node devices anyway (and the hal node device driver does
include them).

This patch allows the udev node device driver to include network
interfaces lacking a "device" symlink as node devices, and sets the
parent property to "computer".

Signed-off-by: Ed Swierk <eswierk at aristanetworks.com>

Index: libvirt-0.7.6/src/node_device/node_device_udev.c
--- libvirt-0.7.6.orig/src/node_device/node_device_udev.c
+++ libvirt-0.7.6/src/node_device/node_device_udev.c
@@ -1220,14 +1220,13 @@ static int udevSetParent(struct udev_dev
     if (parent_device == NULL) {
         VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
-        goto out;
     parent_sysfs_path = udev_device_get_syspath(parent_device);
     if (parent_sysfs_path == NULL) {
         VIR_INFO("Could not get syspath for parent of '%s'",
-        goto out;
+        parent_sysfs_path = "";
     def->parent_sysfs_path = strdup(parent_sysfs_path);

More information about the libvir-list mailing list