[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kvm
Subject:    [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup
From:       "Nicholas A. Bellinger" <nab () linux-iscsi ! org>
Date:       2010-05-31 1:43:01
Message-ID: 1275270181-10992-1-git-send-email-nab () linux-iscsi ! org
[Download RAW message or body]

From: Nicholas Bellinger <nab@linux-iscsi.org>

This patch updates hw/scsi-bus.c to add PERSISTENT_RESERVE_OUT and PERSISTENT_RESERVE_IN
case in scsi_req_length() to extra the incoming buffer length into SCSIRequest->cmd.xfer,
and adds a second PERSISTENT_RESERVE_OUT case in scsi_req_xfer_mode() in order to properly
set SCSI_XFER_TO_DEV for WRITE data.

Tested with Linux KVM guests and Megasas 8708EM2 HBA emulation and TCM_Loop target ports.

Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
 hw/scsi-bus.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index b8e4b71..75ec74e 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -325,6 +325,10 @@ static int scsi_req_length(SCSIRequest *req, uint8_t *cmd)
     case INQUIRY:
         req->cmd.xfer = cmd[4] | (cmd[3] << 8);
         break;
+    case PERSISTENT_RESERVE_OUT:
+    case PERSISTENT_RESERVE_IN:
+        req->cmd.xfer = cmd[8] | (cmd[7] << 8);
+        break;
     }
     return 0;
 }
@@ -389,6 +393,7 @@ static void scsi_req_xfer_mode(SCSIRequest *req)
     case MEDIUM_SCAN:
     case SEND_VOLUME_TAG:
     case WRITE_LONG_2:
+    case PERSISTENT_RESERVE_OUT:
         req->cmd.mode = SCSI_XFER_TO_DEV;
         break;
     default:
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic