From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] virtio-scsi: abort in-flight I/O when the device is reset
Date: Thu, 10 Jan 2013 15:49:08 +0100 [thread overview]
Message-ID: <1357829348-3496-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1357829348-3496-1-git-send-email-pbonzini@redhat.com>
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>
---
hw/virtio-scsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index bfe1860..0715865 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;
--
1.8.1
next prev parent reply other threads:[~2013-01-10 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-10 14:49 [Qemu-devel] [PATCH 0/2] virtio-scsi: abort in-flight I/O when the device is reset Paolo Bonzini
2013-01-10 14:49 ` [Qemu-devel] [PATCH 1/2] qdev: add qbus_reset_all Paolo Bonzini
2013-01-10 18:34 ` Andreas Färber
2013-01-11 17:34 ` Andreas Färber
2013-01-10 14:49 ` Paolo Bonzini [this message]
2013-01-10 15:14 ` [Qemu-devel] [PATCH 0/2] virtio-scsi: abort in-flight I/O when the device is reset Michael S. Tsirkin
2013-01-11 16:46 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357829348-3496-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).