Skip to content

Commit

Permalink
virtio-scsi: abort in-flight I/O when the device is reset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and Anthony Liguori committed Jan 10, 2013
1 parent d0508c3 commit 47a150a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hw/virtio-scsi.c
Expand Up @@ -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;
Expand Down

0 comments on commit 47a150a

Please sign in to comment.