Hi, this is the start of a conversion from directly reading sysfs to using libudev for finding devices and their attributes for libhbalinux. I wanted to see what others felt about this before continuing any further, so please comment away.
The sysfs scanning code in libhbalinux has a number of problems in the assumptions it makes. I was motivated to look at this because of fcoeadm refusing to display fcoe over non-PCI network interfaces. Beyond that, virtio devices in a VM that do have a parent PCI device also were not detected correctly; the existing readlink calls to walk the device tree aren't enough to find the true device path outside of the narrow case of what libhbalinux is expecting. For virtio_net, the net device parent is not a PCI-device but a virtio channel. The next parent up is a virtual PCI device, however finding it involves resolving another symlink (libhbalinux doesn't have the full device path like it thinks). These specific cases could be improved on by replacing the readlink calls with realpath, but it would still fall short of the guidelines in sysfs-rules.txt. And libudev already takes care of the details, so why not use it? Chris Leech (6): add libudev to the build scan for fc_host with libudev use libudev to read fc_host attributes move pci scanning to sub-function read most pci attributes with libudev use libudev for finding parents Makefile.am | 6 +- adapt_impl.h | 2 +- configure.ac | 4 + libhbalinux.spec.in | 2 +- lport.c | 511 ++++++++++++++++++++++++++-------------------------- 5 files changed, 265 insertions(+), 260 deletions(-) -- 1.9.3 _______________________________________________ fcoe-devel mailing list fcoe-devel@open-fcoe.org http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel