From 9ef9ca824beaa2069c7a02982daf7bc2ab72124e Mon Sep 17 00:00:00 2001 From: rusty Date: Tue, 3 Sep 2013 00:55:29 +0000 Subject: 2.5.6.6.3: add configuration change event This adds an event for changes to LUN parameters, for example capacity. These are reported in virtio-blk via configuration changes, and we want a similar functionality in virtio-scsi too. There is no list of supported parameter changes, instead we just refer to the list of sense codes in the SCSI specification. This event will usually be serviced in one of three ways: 1) call an OS service to revalidate the disk, either always or only for some specific sense codes; 2) somehow pass the sense directly to the upper-level driver; 3) inject a TEST UNIT READY command into the upper-level device, so that the OS will see the unit attention code and react. Of course a mix of the three is also possible, depending on how the driver writer prefers to have his layering violations served. Signed-off-by: Paolo Bonzini See: https://lists.oasis-open.org/archives/virtio-comment/201308/msg00032.html Signed-off-by: Rusty Russell git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@30 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652 --- virtio-v1.0-wd01-part1-specification.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'virtio-v1.0-wd01-part1-specification.txt') diff --git a/virtio-v1.0-wd01-part1-specification.txt b/virtio-v1.0-wd01-part1-specification.txt index e6a6f08..bc2de67 100644 --- a/virtio-v1.0-wd01-part1-specification.txt +++ b/virtio-v1.0-wd01-part1-specification.txt @@ -2032,6 +2032,9 @@ targets that receive and process the requests. VIRTIO_SCSI_F_HOTPLUG (1) The host should enable hot-plug/hot-unplug of new LUNs and targets on the SCSI bus. + VIRTIO_SCSI_F_CHANGE (2) The host will report changes to LUN + parameters via a VIRTIO_SCSI_T_PARAM_CHANGE event. + 2.4.6.4. Device configuration layout ----------------------------------- @@ -2492,6 +2495,24 @@ contents of the event field. The following events are defined: When dropped events are reported, the driver should poll for asynchronous events manually using SCSI commands. + LUN parameter change + #define VIRTIO_SCSI_T_PARAM_CHANGE 3 + + By sending this event, the device signals that the configuration parameters + (for example the capacity) of a logical unit have changed. + The event field is set to VIRTIO_SCSI_T_PARAM_CHANGE. + The lun field addresses a logical unit in the SCSI host. + + The same event is also reported as a unit attention condition. + The reason field contains the additional sense code and additional sense code qualifier, + respectively in bits 0..7 and 8..15. + For example, a change in capacity will be reported as asc 0x2a, ascq 0x09 + (CAPACITY DATA HAS CHANGED). + + For MMC devices (inquiry type 5) there would be some overlap between this + event and the asynchronous notification event. + For simplicity, as of this version of the specification the host must + never report this event for MMC devices. 2.5. Reserved Feature Bits ========================= -- cgit v1.2.3