aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-scsi.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-10 15:49:08 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-01-10 15:22:42 -0600
commit47a150a4bbb06e45ef439a8222e9f46a7c4cca3f (patch)
tree2ddb17409159da6599701f1dc7d853bada4addea /hw/virtio-scsi.c
parentd0508c3664290baad379f6513c92cae6e5aac95b (diff)
virtio-scsi: abort in-flight I/O when the device is reset
When the device is reset, the SCSI bus should also be reset so that in-flight I/O is cancelled. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-scsi.c')
-rw-r--r--hw/virtio-scsi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index bfe1860505..0715865489 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -565,6 +565,10 @@ static void virtio_scsi_reset(VirtIODevice *vdev)
{
VirtIOSCSI *s = (VirtIOSCSI *)vdev;
+ s->resetting++;
+ qbus_reset_all(&s->bus.qbus);
+ s->resetting--;
+
s->sense_size = VIRTIO_SCSI_SENSE_SIZE;
s->cdb_size = VIRTIO_SCSI_CDB_SIZE;
s->events_dropped = false;