[libvirt] [PATCH 5/5]: Rewrite findLuns function

Chris Lalancette clalance at redhat.com
Mon Jun 16 13:52:51 UTC 2008


This rather large patch rewrites the virStorageBackendISCSIFindLUNs() function
to only rely on sysfs for finding LUNs, given a session number.  Along the way,
it also fixes the bug where we wouldn't find LUNs for older kernels (with the
block:sda format), and also (possibly) fixes a race condition where we could try
to find the LUN before udev has finished connecting it.  I say it "possibly"
fixes it because I haven't been able to hit it so far, but I definitely need
more testing to try and confirm.

Changes since last time:
1)  Don't blindly ignore the 0'th LUN (thanks Stefan).  Instead, look if the
LUNs are Direct-Access devices (as defined by the kernel); if so, they are LUNs
we can use.
2)  Fix up whitespace damage.
3)  Check the return value of the scsidev strdup as pointed out by Jim.
4)  Change all ISCSIADM commands to be const char *const as pointed out by Jim.

Signed-off-by: Chris Lalancette <clalance at redhat.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-iscsi-rewrite-findluns-2.patch
Type: text/x-patch
Size: 15932 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080616/c788e1ff/attachment-0001.bin>


More information about the libvir-list mailing list