From 3653d8c40e04d78eb6b5b069522daf7cc72d4f06 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 13 Sep 2011 16:19:53 +0200 Subject: scsi: notify the device when unit attention is reported Reporting media change events via unit attention sense codes requires a small state machine: first report "NO MEDIUM", then report "MEDIUM MAY HAVE CHANGED". Unfortunately there is no good hooking point for the device to notice that its pending unit attention condition has been reported. This patch reworks the generic machinery to add one. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- hw/scsi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/scsi.h') diff --git a/hw/scsi.h b/hw/scsi.h index e8dcabf..6d40b8e 100644 --- a/hw/scsi.h +++ b/hw/scsi.h @@ -62,6 +62,7 @@ struct SCSIDevice BlockConf conf; SCSIDeviceInfo *info; SCSISense unit_attention; + bool sense_is_ua; uint8_t sense[SCSI_SENSE_BUF_SIZE]; uint32_t sense_len; QTAILQ_HEAD(, SCSIRequest) requests; @@ -92,6 +93,7 @@ struct SCSIDeviceInfo { void (*destroy)(SCSIDevice *s); SCSIRequest *(*alloc_req)(SCSIDevice *s, uint32_t tag, uint32_t lun, void *hba_private); + void (*unit_attention_reported)(SCSIDevice *s); SCSIReqOps reqops; }; -- cgit v1.1