9ae3a8
From 684c8889083b1479d64c7a04b2d0dd8b9961d46d Mon Sep 17 00:00:00 2001
9ae3a8
From: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Date: Mon, 3 Aug 2015 16:51:20 +0200
9ae3a8
Subject: [PATCH 06/13] scsi-disk: fix cmd.mode field typo
9ae3a8
9ae3a8
Message-id: <1438620680-24121-3-git-send-email-stefanha@redhat.com>
9ae3a8
Patchwork-id: 67256
9ae3a8
O-Subject: [RHEL-7.2 qemu-kvm PATCH 2/2] scsi-disk: fix cmd.mode field typo
9ae3a8
Bugzilla: 1249718
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
The cmd.xfer field is the data length.  The cmd.mode field is the data
9ae3a8
transfer direction.
9ae3a8
9ae3a8
scsi_handle_rw_error() was using the wrong error policy for read
9ae3a8
requests.
9ae3a8
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Message-Id: <1438262173-11546-3-git-send-email-stefanha@redhat.com>
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
(cherry picked from commit c85a7a0057ca454607a40cde991d495e0deec34d)
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/scsi/scsi-disk.c | 2 +-
9ae3a8
 1 file changed, 1 insertion(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
9ae3a8
index 50b7910..8a8b0ab 100644
9ae3a8
--- a/hw/scsi/scsi-disk.c
9ae3a8
+++ b/hw/scsi/scsi-disk.c
9ae3a8
@@ -413,7 +413,7 @@ static void scsi_read_data(SCSIRequest *req)
9ae3a8
  */
9ae3a8
 static int scsi_handle_rw_error(SCSIDiskReq *r, int error)
9ae3a8
 {
9ae3a8
-    bool is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV);
9ae3a8
+    bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV);
9ae3a8
     SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
9ae3a8
     BlockErrorAction action = bdrv_get_error_action(s->qdev.conf.bs, is_read, error);
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8