136f17e nodeinfo: Check for SYSFS_INFINIBAND_DIR before open

Authored and Committed by John Ferlan 8 years ago
    nodeinfo: Check for SYSFS_INFINIBAND_DIR before open
    
    Commit id 'ac3ed2085' causes 'virsh nodedev-list --cap net' to fail
    on any system without SYSFS_INFINIBAND_DIR (/sys/class/infiniband).
    
    Rather than assume it's there and fail on the attempt to open the
    non-existent directory, check if it's there - if not, return
    success and move on. Also fix caller to check < 0 upon return.
    
    As reported by Suren Hajyan <shajyan@redhat.com> from run of unit tests
    
        
file modified
+4 -1