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