scsi: do not call scsi_read_data/scsi_write_data for a canceled request
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Feb 2013 11:12:58 +0000 (12:12 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Apr 2013 15:53:33 +0000 (10:53 -0500)
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 6f6710aa99ac53b59ff0f14380830cb9ab6bdc14)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi-bus.c
trace-events

index a97f1cdc1c74d7d6ce55dad659be1495eacd64be..01e1dec4ca577f7674c5619e2e3e51866da38114 100644 (file)
@@ -1508,6 +1508,10 @@ void scsi_req_unref(SCSIRequest *req)
    will start the next chunk or complete the command.  */
 void scsi_req_continue(SCSIRequest *req)
 {
+    if (req->io_canceled) {
+        trace_scsi_req_continue_canceled(req->dev->id, req->lun, req->tag);
+        return;
+    }
     trace_scsi_req_continue(req->dev->id, req->lun, req->tag);
     if (req->cmd.mode == SCSI_XFER_TO_DEV) {
         req->ops->write_data(req);
index 1011f27676609e6d9b0ba13ab44c652aedb7f6d2..167f4812c87e97dbc5a3853e457e9a8be8d00781 100644 (file)
@@ -460,6 +460,7 @@ scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d le
 scsi_req_data_canceled(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d"
 scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d"
 scsi_req_continue(int target, int lun, int tag) "target %d lun %d tag %d"
+scsi_req_continue_canceled(int target, int lun, int tag) "target %d lun %d tag %d"
 scsi_req_parsed(int target, int lun, int tag, int cmd, int mode, int xfer) "target %d lun %d tag %d command %d dir %d length %d"
 scsi_req_parsed_lba(int target, int lun, int tag, int cmd, uint64_t lba) "target %d lun %d tag %d command %d lba %"PRIu64
 scsi_req_parse_bad(int target, int lun, int tag, int cmd) "target %d lun %d tag %d command %d"