aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-04-19 10:09:49 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-04-19 15:27:19 +0200
commitb8aba8d7e3031ee3411a8e5eb07ac61f5b18f045 (patch)
tree7251d1c07164e4e46f499d43f46794a1c194494b /hw
parentd2ad7dd46e72118a577e16b3c6dffdc43c961476 (diff)
scsi: add missing test for cancelled request
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi-disk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 9949786e52..792e9d045a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -171,7 +171,9 @@ static void scsi_dma_complete(void *opaque, int ret)
scsi_req_complete(&r->req, GOOD);
done:
- scsi_req_unref(&r->req);
+ if (!r->req.io_canceled) {
+ scsi_req_unref(&r->req);
+ }
}
static void scsi_read_complete(void * opaque, int ret)