From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52330 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOsMY-0000Dp-BE for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOsMW-0000oB-SD for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:09:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62879) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOsMW-0000nu-Ld for qemu-devel@nongnu.org; Wed, 16 Jun 2010 09:09:00 -0400 Message-ID: <4C18CCC5.70109@redhat.com> Date: Wed, 16 Jun 2010 15:08:21 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup References: <1275270181-10992-1-git-send-email-nab@linux-iscsi.org> <4C090883.70704@redhat.com> <4C18C001.4050106@redhat.com> <1276693399.12514.221.camel@haakon2.linux-iscsi.org> In-Reply-To: <1276693399.12514.221.camel@haakon2.linux-iscsi.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: Gerd Hoffmann , kvm-devel , qemu-devel , Hannes Reinecke , Christoph Hellwig , Paul Brook Am 16.06.2010 15:03, schrieb Nicholas A. Bellinger: > On Wed, 2010-06-16 at 14:13 +0200, Kevin Wolf wrote: >> Am 04.06.2010 16:06, schrieb Kevin Wolf: >>> Am 31.05.2010 03:43, schrieb Nicholas A. Bellinger: >>>> From: Nicholas Bellinger >>>> >>>> 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 >>>> --- >>>> 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); >>> >>> Maybe I'm missing something, but isn't exactly the same value set in the >>> switch block above? (for cmd[0] >> 5 == 2) >> >> Nicholas? This isn't applied yet because I'm waiting for your answer. >> >> Is there a reason why it makes sense to do it explicitly here instead >> using the generic code a few lines above? I think the same applied to >> patch 2/2. > > Hi Kevin, > > I just tested this again and you are correct, the reassignment of > req->cmd.xfer for PR and Maintence CDBs is unnecessary in > scsi_req_length(). I will go ahead and drop part this from my tree. > > Please let me know if you would like me to resend the patch series. Sure, taking simpler code is always better, so I'd be happier with a v2. Kevin