From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] scsi-disk: do not complete requests twice
Date: Fri, 7 Oct 2011 10:59:12 +0200 [thread overview]
Message-ID: <1317977954-21366-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1317977954-21366-1-git-send-email-pbonzini@redhat.com>
When scsi_handle_rw_error reports a CHECK CONDITION code, the
owner should not call scsi_req_complete.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi-disk.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 4757a02..6497655 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -230,6 +230,7 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
vm_stop(RSTATE_IO_ERROR);
+ return 1;
} else {
switch (error) {
case ENOMEDIUM:
@@ -246,8 +247,8 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
break;
}
bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read);
+ return 0;
}
- return 1;
}
static void scsi_write_complete(void * opaque, int ret)
--
1.7.6
next prev parent reply other threads:[~2011-10-07 8:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 8:59 [Qemu-devel] [PATCH 0/4] scsi: miscellaneous fixes Paolo Bonzini
2011-10-07 8:59 ` [Qemu-devel] [PATCH 1/4] scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0 Paolo Bonzini
2011-10-07 8:59 ` Paolo Bonzini [this message]
2011-10-07 8:59 ` [Qemu-devel] [PATCH 3/4] scsi-disk: bump SCSIRequest reference count until aio completion runs Paolo Bonzini
2011-10-07 8:59 ` [Qemu-devel] [PATCH 4/4] scsi-disk: fix retrying a flush Paolo Bonzini
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=1317977954-21366-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@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).