RE: How to add/drop SCSI drives from within the driver?

From: Mukker, Atul
Date: Wed Dec 08 2004 - 14:38:34 EST


> The real way I'd like to handle this is via hotplug. The
> hotplug event would transmit the HCTL in the environment.
> Whether the drive actually gets incorporated into the system
> and where is user policy, so it's appropriate that it should
> be in userland.
Hmm, is it possible for applications to create hotplug events? If it is,
this could a good idea as matter of system policies. Regardless, our
management applications interfaces with the firmware in terms of logical
drive numbers. Driver converts this number to the scsi host, bus, target etc
during all interactions with kernel. In order for applications to actually
notify kernel about arrival or removal of logical drives (hotplug event or
sysfs), it has to know the corresponding mapping used by driver, while
registering or would be registering, the device in question.

Since the mapping is private to the driver, it only can tell to application,
for a give logical driver *number* the corresponding scsi address

> > Removing a drive:- There is no sane way for the application
> to map out
> > drives to /dev/sd<x>. If application has a way of knowing
> the HCTL of
> > a deleted drive, then using that HCTL, it can match the
> corresponding
> > SCSI device name (/dev/sd<x>) and use sysfs to remove that drive.
>
> Since The sysfs device name contains H:C:T:L surely you can
> just do a find on /sys?

Again, there is no way for applications to relate H:C:T:L with a logical
drive number. This information must come from the driver.

Thanks
-Atul Mukker
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/