From 6ce09dd65230d2b9f06593f84f3e13e29397bd4d Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 3 Aug 2015 14:38:22 +0200 Subject: [PATCH 2/4] scsi-disk: fix cmd.mode field typo Message-id: <1438612702-9236-3-git-send-email-stefanha@redhat.com> Patchwork-id: 67253 O-Subject: [RHEV-7.2 qemu-kvm-rhev PATCH 2/2] scsi-disk: fix cmd.mode field typo Bugzilla: 1160169 RH-Acked-by: Thomas Huth RH-Acked-by: Fam Zheng RH-Acked-by: Miroslav Rezanina The cmd.xfer field is the data length. The cmd.mode field is the data transfer direction. scsi_handle_rw_error() was using the wrong error policy for read requests. Signed-off-by: Stefan Hajnoczi Message-Id: <1438262173-11546-3-git-send-email-stefanha@redhat.com> Signed-off-by: Paolo Bonzini (cherry picked from commit c85a7a0057ca454607a40cde991d495e0deec34d) Signed-off-by: Stefan Hajnoczi Signed-off-by: Miroslav Rezanina --- hw/scsi/scsi-disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 54d71f4..36317fb 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -399,7 +399,7 @@ static void scsi_read_data(SCSIRequest *req) */ static int scsi_handle_rw_error(SCSIDiskReq *r, int error) { - bool is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV); + bool is_read = (r->req.cmd.mode == SCSI_XFER_FROM_DEV); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); BlockErrorAction action = blk_get_error_action(s->qdev.conf.blk, is_read, error); -- 1.8.3.1