[libvirt] [RFC 5/5]: Rewrite findLuns function
Chris Lalancette
clalance at redhat.com
Thu Jun 12 15:20:19 UTC 2008
Daniel P. Berrange wrote:
>> # cat /sys/bus/scsi/devices/3:0:0:0/model
>>
>> and
>>
>> # cat /sys/bus/scsi/devices/3:0:0:0/type
>>
>> from both your netapp target and your sun target? Here, at least, for our
>> "control" LUN, model returns "Controller" while for the real LUNs model returns
>> "VIRTUAL-DISK", so I'm hoping I can distinguish somehow based on what is in
>> model, and if not that, based on type.
>
> Can't you distinguish based on the fact that there'll be no /dev/sdNN
> node for it ?
Unfortunately, no. The /sys/bus/scsi/devices/3:0:0:0/block:sda (or block/sda)
link will only exist once udev has finished plugging the device in. So we have
to loop waiting for that to appear. In the case of a control LUN, that will
never appear, so we will wait 5 seconds (the current default) to see it appear,
and then when it doesn't, we won't know how to distinguish the error case from
the control LUN case. I guess we could just not throw an error if we never see
a block device, but we would still delay the libvirtd daemon (and the client)
unnecessarily.
Chris Lalancette
More information about the libvir-list
mailing list