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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/03/2010 03:58 PM, Ed Swierk wrote:
> 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@xxxxxxxxxxxxxxxxxx>
> 
> ---
> 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'",
>                   udev_device_get_syspath(device));
> -        goto out;
>      }
>  
>      parent_sysfs_path = udev_device_get_syspath(parent_device);

Where is udev_device_get_syspath declared?  I'm assuming it's generated,
since 'git grep' didn't find it.  The only concern I have is whether it
sanely reacts to a NULL argument, but since I couldn't find it, I'm not
sure.  If it gracefully returns NULL on a NULL argument, then...

>      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 = "";
>      }

ACK

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]