> (There are some that hotplug the whole *bus*, e.g. scsa2usb and 
> scsa1394, but not individual targets.)

Well, at least case of USB and 1394 cases, there isn't a difference 
between whole "bus" and target, because the physical "SCSI bus" is never 
exposed to the host OS. Hot-insertion is done in a bus-specific fashion, 
generally HBA's parent nexus triggers HBA's bus_config NDI entry point, 
wherein the HBA enumerates its own children and creates nodes as needed, 
settings "compatible" property according to device type ("disk", "tape", 
etc). The kernel then binds the target driver as usual.

Hot-removal is done similarly, via bus_unconfig. Surprise removal is 
trickier, because kernel nodes are not removed if busy, e.g. in use by a 
filesystem. That case is handled, rather awkwardly, by returning 
pkt_reason CMD_DEV_GONE, which translates to userland DKIO_DEV_GONE. 
Some history can be found in 6256272.

Eric took it one step further in PSARC/2007/197 ZFS hotplug.

-Artem
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to