|
Description
|
Automated hotplug testing is a difficult task, because it requires
physical access to the hardware and manual intervention. While this
will always be required for testing hardware hotplug support, it
would be nice to test layered software (volume management, ZFS, etc)
entirely in software.
PSARC 2006/709 goes part of the way by introducing devfs
events for EC_DEV_{ADD,REMOVE} when lofi devices are created or
destroyed. However, there is no way to simulate a forced
removal of a device (i.e. yanking a drive while it's still in
use).
A new private flag can be added to 'lofiadm -d' which will forcibly
unmap the underlying device. This will immediately close the
underlying vnode (modulo any pending I/O operations), and leave the
lofi device in a deatched state. Any attempt to open or issue
I/O to the device will fail, and the DKIOCSTATE ioctl will return
DKIO_DEV_GONE.
|