diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2011-09-13 16:19:53 +0200 |
|---|---|---|
| committer | Kevin Wolf <kwolf@redhat.com> | 2011-10-28 19:25:50 +0200 |
| commit | 3653d8c40e04d78eb6b5b069522daf7cc72d4f06 (patch) | |
| tree | a2aceb4fd51cfc13bbc19b876762df5bc72d9aa0 /hw/scsi.h | |
| parent | af0e1ea2d32eafd837c51326368ce2d8f36e6871 (diff) | |
| download | focaccia-qemu-3653d8c40e04d78eb6b5b069522daf7cc72d4f06.tar.gz focaccia-qemu-3653d8c40e04d78eb6b5b069522daf7cc72d4f06.zip | |
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.h | 2 |
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; }; |