qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Kevin Wolf <kwolf@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	Nicholas Bellinger <nab@linux-iscsi.org>,
	Paul Brook <paul@codesourcery.com>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>
Subject: [Qemu-devel] [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup
Date: Sun, 30 May 2010 18:43:01 -0700	[thread overview]
Message-ID: <1275270181-10992-1-git-send-email-nab@linux-iscsi.org> (raw)

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

             reply	other threads:[~2010-05-31  1:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31  1:43 Nicholas A. Bellinger [this message]
2010-06-04 14:06 ` [Qemu-devel] Re: [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup Kevin Wolf
2010-06-16 12:13   ` Kevin Wolf
2010-06-16 13:03     ` Nicholas A. Bellinger
2010-06-16 13:08       ` Kevin Wolf
2010-06-16 13:09       ` Nicholas A. Bellinger
2010-06-16 13:23         ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1275270181-10992-1-git-send-email-nab@linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).