]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodeinfo: Check for SYSFS_INFINIBAND_DIR before open
authorJohn Ferlan <jferlan@redhat.com>
Thu, 23 Jul 2015 18:33:32 +0000 (14:33 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 24 Jul 2015 13:41:06 +0000 (09:41 -0400)
commit136f17efd123593abed4d7d7a18e147bbf534527
treeca9235dc614940000a14ffacf575c43daebbeec1
parentc1c5eb6fada7aeeda107661769534b59ad99ff4b
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
src/util/virnetdev.c