]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fix issue finding LU's when block doesn't exist
authorJohn Ferlan <jferlan@redhat.com>
Wed, 19 Nov 2014 15:06:22 +0000 (10:06 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Nov 2014 15:24:11 +0000 (10:24 -0500)
commit20870417322f7090d32e31cde864a2f916f55181
treeab8e3c0165dcd92d3ea1447458824381800ffa65
parent0798efcc40c89a8c7fa1cf04aa6aa3f6f0905b45
storage: Fix issue finding LU's when block doesn't exist

Fix a problem in the getBlockDevice and processLU where retval initialized
to zero causing some failures to erroneously continue through to the
virStorageBackendSCSINewLun with an attempt to find a path for "/dev/(null)".
This would fail approximately 10 seconds later with debug message:

virStorageBackendSCSINewLun:203 :
     No stable path found for '/dev/(null)' in '/dev/disk/by-path'

The root cause of the issue is for many /sys/bus/scsi/devices/<lun path>
there is no "block*" device found for the vHBA's, where "<lun path>" are
the various paths created for the vHBA, such as "17:0:0:0", "17:0:1:0",
"17:0:2:0", "17:0:3:0", etc.  If the block device isn't found, then the
directory should just be ignored rather than attempting to process it.

The bug was that in getBlockDevice the assumption was "block" would exist
and either getNewStyleBlockDevice or getOldStyleBlockDevice would fill in
@block_device. However, if 'block*' doesn't exist, then the code returned
NULL for block_device *and* a good (zero) retval value.  This caused the
processLU code to attempt the virStorageBackendSCSINewLun which failed
"at some point in time" in the future.

After this change - on test system the refresh-pool didn't have a noticable
pause of about 20 seconds - it completed within a second since no longer
was there an attempt/need to find "/dev/(null)".

Additionally, the virStorageBackendSCSIFindLU's shouldn't be declaring
found unless the processLU actually returns success. This will be
important in the followup patch which relies on whether a LU was found.
src/storage/storage_backend_scsi.c