aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-13 16:19:53 +0200
committerKevin Wolf <kwolf@redhat.com>2011-10-28 19:25:50 +0200
commit3653d8c40e04d78eb6b5b069522daf7cc72d4f06 (patch)
treea2aceb4fd51cfc13bbc19b876762df5bc72d9aa0 /hw/scsi.h
parentaf0e1ea2d32eafd837c51326368ce2d8f36e6871 (diff)
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 <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index e8dcabfa28..6d40b8e4f9 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;
};