summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-01-27 17:16:59 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2015-02-02 16:55:11 +0100
commit2aeba9d8a1b6121b98948fcd42fd2aa32f68b750 (patch)
tree3a721ebd30f28055c182ab3326ef8556e5e53a46
parent2e91cc62f29a7359d00576a250a10892e00c95b4 (diff)
downloadqemu-2aeba9d8a1b6121b98948fcd42fd2aa32f68b750.tar.gz
qemu-2aeba9d8a1b6121b98948fcd42fd2aa32f68b750.tar.bz2
qemu-2aeba9d8a1b6121b98948fcd42fd2aa32f68b750.zip
scsi: Fix scsi_req_cancel_async for no aiocb req
scsi_req_cancel_complete is responsible for releasing the request, so we shouldn't skip it in any case. This doesn't affect the only existing caller, virtio-scsi, but is useful for other devices once they use it. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/scsi/scsi-bus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 9b740a3cfa..db39ae0e23 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1756,6 +1756,8 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
req->io_canceled = true;
if (req->aiocb) {
blk_aio_cancel_async(req->aiocb);
+ } else {
+ scsi_req_cancel_complete(req);
}
}