Patchwork [02/32] megasas: fix misuse of scsi_req_abort

login
register
mail settings
Submitter Paolo Bonzini
Date July 27, 2012, 3:02 p.m.
Message ID <1343401379-19495-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/173739/
State New
Headers show

Comments

Paolo Bonzini - July 27, 2012, 3:02 p.m.
scsi_req_abort is for terminating a command with a non-zero status.
The ABORT task management function is invoked by scsi_req_cancel.
In fact, ABORTED_COMMAND is a sense key, not a SAM status code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/megasas.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/hw/megasas.c b/hw/megasas.c
index c389ddf..9a0eab1 100644
--- a/hw/megasas.c
+++ b/hw/megasas.c
@@ -544,7 +544,7 @@  static void megasas_reset_frames(MegasasState *s)
 static void megasas_abort_command(MegasasCmd *cmd)
 {
     if (cmd->req) {
-        scsi_req_abort(cmd->req, ABORTED_COMMAND);
+        scsi_req_cancel(cmd->req);
         cmd->req = NULL;
     }
 }