scsi: notify the device when unit attention is reported
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 13 Sep 2011 14:19:53 +0000 (16:19 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 Oct 2011 17:25:50 +0000 (19:25 +0200)
commit98e69e6af870192c3eb8b29f5d6662fb752a751f
treea2aceb4fd51cfc13bbc19b876762df5bc72d9aa0
parent82d847917cfe3493c4b0a0d4abfd99b0fdebe305
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>
hw/scsi-bus.c
hw/scsi.h