]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Allow devices without a parent
authorEd Swierk <eswierk@aristanetworks.com>
Wed, 10 Mar 2010 18:48:49 +0000 (13:48 -0500)
committerDavid Allan <dallan@redhat.com>
Wed, 10 Mar 2010 22:25:54 +0000 (17:25 -0500)
* Allow devices without parent links to be created and set their parent to the root "computer" node

src/node_device/node_device_udev.c

index a6ca7856cef7de7b187a21085a9e2a965ac07912..11e27e0662611fa2c32d1cef54639f350410ff18 100644 (file)
@@ -1220,14 +1220,13 @@ static int udevSetParent(struct udev_device *device,
     if (parent_device == NULL) {
         VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
                  udev_device_get_syspath(device));
-        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'",
                  udev_device_get_syspath(device));
-        goto out;
+        parent_sysfs_path = "";
     }
 
     def->parent_sysfs_path = strdup(parent_sysfs_path);