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 fixes a race condition where we could try to find the LUN before udev has finished connecting it.
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 fixes a race condition where we could try
to find the LUN before udev has finished connecting it.

This patch fixes a few different bugs:
1) We weren't finding LUNs on pre 2.6.24 kernels
2) libvirtd sysfs scanning was racing with udev, so we didn't always see LUNs
3) We weren't showing the 0'th LUN, although that can be a valid LUN

Signed-off-by: Chris Lalancette <60b62644009db6b194cc0445b64e9b27bb26433a@redhat.com>

warewolf/libvirt,novel/fbsd-libvirt,jardasgit/libvirt,VenkatDatta/libvirt,kantai/libvirt-vfork,nertpinx/libvirt,zippy2/libvirt,usc-isi/libvirt,novel/fbsd-libvirt,iam-TJ/libvirt,bjzhang/libvirt,eskultety/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,agx/libvirt,zippy2/libvirt,jeckersb/libvirt,jfehlig/libvirt,nertpinx/libvirt,zippy2/libvirt,wiedi/libvirt,rbu/libvirt,soulxu/libvirt-xuhj,crobinso/libvirt,warewolf/libvirt,rmarwaha/libvirt1,siboulet/libvirt-openvz,cbosdo/libvirt,jeckersb/libvirt,wiedi/libvirt,amery/libvirt-vserver,jardasgit/libvirt,warewolf/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,rmarwaha/libvirt1,leilihh/libvirt,shugaoye/libvirt,shugaoye/libvirt,elmarco/libvirt,rmarwaha/libvirt1,rmarwaha/libvirt1,zhlcindy/libvirt-1.1.4-maintain,taget/libvirt,shugaoye/libvirt,wiedi/libvirt,taget/libvirt,trainstack/libvirt,foomango/libvirt,VenkatDatta/libvirt,warewolf/libvirt,amery/libvirt-vserver,sshah-solarflare/Libvirt-PCI-passthrough-,warewolf/libvirt,emaste/libvirt,novel/fbsd-libvirt,zippy2/libvirt,shugaoye/libvirt,taget/libvirt,rbu/libvirt,danwent/libvirt-ovs,fabianfreyer/libvirt,rmarwaha/libvirt,datto/libvirt,novel/fbsd-libvirt,bjzhang/libvirt,jeckersb/libvirt,trainstack/libvirt,rmarwaha/libvirt1,warewolf/libvirt,rbu/libvirt,siboulet/libvirt-openvz,emaste/libvirt,datto/libvirt,foomango/libvirt,jeckersb/libvirt,iam-TJ/libvirt,crobinso/libvirt,foomango/libvirt,libvirt/libvirt,rlaager/libvirt,VenkatDatta/libvirt,amery/libvirt-vserver,andreabolognani/libvirt,crobinso/libvirt,dumbbell/libvirt,emaste/libvirt,agx/libvirt,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,andreabolognani/libvirt,siboulet/libvirt-openvz,trainstack/libvirt,novel/fbsd-libvirt,agx/libvirt,kantai/libvirt-vfork,emaste/libvirt,novel/fbsd-libvirt,wiedi/libvirt,danwent/libvirt-ovs,eskultety/libvirt,datto/libvirt,warewolf/libvirt,usc-isi/libvirt,zhlcindy/libvirt-1.1.4-maintain,iam-TJ/libvirt,rlaager/libvirt,fabianfreyer/libvirt,rmarwaha/libvirt,olafhering/libvirt,olafhering/libvirt,VenkatDatta/libvirt,trainstack/libvirt,trainstack/libvirt,agx/libvirt,jeckersb/libvirt,dumbbell/libvirt,cbosdo/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,leilihh/libvirt,usc-isi/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,nertpinx/libvirt,libvirt/libvirt,danwent/libvirt-ovs,kantai/libvirt-vfork,libvirt/libvirt,emaste/libvirt,rmarwaha/libvirt1,siboulet/libvirt-openvz,foomango/libvirt,dumbbell/libvirt,emaste/libvirt,rlaager/libvirt,eskultety/libvirt,novel/fbsd-libvirt,leilihh/libvirt,jardasgit/libvirt,leilihh/libvirt,rbu/libvirt,wiedi/libvirt,cbosdo/libvirt,soulxu/libvirt-xuhj,bjzhang/libvirt,foomango/libvirt,jfehlig/libvirt,iam-TJ/libvirt,andreabolognani/libvirt,rbu/libvirt,dumbbell/libvirt,iam-TJ/libvirt,amery/libvirt-vserver,kantai/libvirt-vfork,datto/libvirt,libvirt/libvirt,nertpinx/libvirt,usc-isi/libvirt,rlaager/libvirt,nertpinx/libvirt,leilihh/libvirt,fabianfreyer/libvirt,iam-TJ/libvirt,rmarwaha/libvirt,eskultety/libvirt,rlaager/libvirt,dumbbell/libvirt,trainstack/libvirt,andreabolognani/libvirt,zhlcindy/libvirt-1.1.4-maintain,elmarco/libvirt,dumbbell/libvirt,zhlcindy/libvirt-1.1.4-maintain,danwent/libvirt-ovs,olafhering/libvirt,bjzhang/libvirt,leilihh/libvirt,soulxu/libvirt-xuhj,jfehlig/libvirt,olafhering/libvirt,cbosdo/libvirt,rmarwaha/libvirt,jeckersb/libvirt,taget/libvirt,novel/fbsd-libvirt,datto/libvirt,eskultety/libvirt,taget/libvirt,rmarwaha/libvirt,jardasgit/libvirt,usc-isi/libvirt,amery/libvirt-vserver,elmarco/libvirt,jardasgit/libvirt,soulxu/libvirt-xuhj,elmarco/libvirt,bjzhang/libvirt,danwent/libvirt-ovs,iam-TJ/libvirt,crobinso/libvirt,trainstack/libvirt,jfehlig/libvirt,emaste/libvirt,agx/libvirt,wiedi/libvirt,jeckersb/libvirt,siboulet/libvirt-openvz,cbosdo/libvirt,wiedi/libvirt,soulxu/libvirt-xuhj,elmarco/libvirt,kantai/libvirt-vfork,fabianfreyer/libvirt,rmarwaha/libvirt,sshah-solarflare/Libvirt-PCI-passthrough-,fabianfreyer/libvirt,novel/fbsd-libvirt