diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-04-18 17:14:51 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2011-05-26 12:14:15 +0200 |
commit | 19d110ab8af3308ce58d0936f085f0124930e7e7 (patch) | |
tree | 66655ab907e2b6f1ea43dce26b394789fbd1e280 /hw/spapr_vscsi.c | |
parent | c557e889156c5f5da23b4b047aea804aefce4982 (diff) |
scsi: introduce scsi_req_abort
This covers the case of canceling a request's I/O and still
completing it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/spapr_vscsi.c')
-rw-r--r-- | hw/spapr_vscsi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c index 36dd7445af..24cebd1843 100644 --- a/hw/spapr_vscsi.c +++ b/hw/spapr_vscsi.c @@ -463,10 +463,8 @@ static void vscsi_send_request_sense(VSCSIState *s, vscsi_req *req) dprintf("VSCSI: Queued request sense tag 0x%x\n", req->qtag); if (n < 0) { fprintf(stderr, "VSCSI: REQUEST_SENSE wants write data !?!?!?\n"); - sdev->info->cancel_io(req->sreq); vscsi_makeup_sense(s, req, HARDWARE_ERROR, 0, 0); - vscsi_send_rsp(s, req, CHECK_CONDITION, 0, 0); - vscsi_put_req(s, req); + scsi_req_abort(req->sreq, CHECK_CONDITION); return; } else if (n == 0) { return; @@ -547,10 +545,8 @@ static void vscsi_command_complete(SCSIRequest *sreq, int reason, uint32_t arg) } if (rc < 0) { fprintf(stderr, "VSCSI: RDMA error rc=%d!\n", rc); - sdev->info->cancel_io(sreq); vscsi_makeup_sense(s, req, HARDWARE_ERROR, 0, 0); - vscsi_send_rsp(s, req, CHECK_CONDITION, 0, 0); - vscsi_put_req(s, req); + scsi_req_abort(req->sreq, CHECK_CONDITION); return; } |