[libvirt] [PATCH 1/1] Add SCSI pool support.

Dave Allan dallan at redhat.com
Sat Mar 28 14:40:48 UTC 2009


Daniel P. Berrange wrote:

[snipped code & comments that I'm not addressing here]

>> +static int
>> +virStorageBackendSCSIFindLUs(virConnectPtr conn,
>> +                             virStoragePoolObjPtr pool,
>> +                             uint32_t scanhost,
>> +                             uint32_t scanbus,
>> +                             uint32_t scantarget)
>> +{
>> +    int retval = 0;
>> +    uint32_t host, bus, target, lun;
>> +    char *target_path = NULL;
>> +    DIR *targetdir = NULL;
>> +    struct dirent *lun_dirent = NULL;
>> +
>> +    VIR_DEBUG(_("Discovering LUs on host %u bus %u target %u"),
>> +              scanhost, scanbus, scantarget);
>> +
>> +    if (virAsprintf(&target_path, "/sys/bus/scsi/devices/target%u:%u:%u",
>> +             scanhost, scanbus, scantarget) < 0) {
>> +        virReportOOMError(conn);
>> +        goto out;
>> +    }
> 
> This unfortauntely does not work on RHEL5, because there are no targetX.X.X
> links here. Only the LUNs appear in this directory.
> 
> The location which appears to be present on both old and new kernels is
> under:
> 
>    /sys/class/scsi_host/host0/device/targetX.X.X
> 
> This appears to be present for both SCSI and iSCSI hosts.

Unfortunately, that directory isn't present for FC hosts on F10.  :( 
I've put together a scan strategy that I think will for for both RHEL5 
and F10 for all transport types.  Let me know if it works for you.  The 
attached patch should be applied on top of the udev fix I sent 
yesterday.  This patch is another one that doesn't read well as a patch, 
but should be pretty straightforward once it's applied.

I have not addressed the question of what device types to allow, because 
I want to think about that one a bit more.

I also took out the unused struct you noticed.

Thanks for all the feedback and testing.

Dave
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Changes-based-on-feedback-from-DanPB.patch
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090328/85de1ac1/attachment-0001.ksh>


More information about the libvir-list mailing list