From patchwork Wed Jun 16 13:09:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 106488 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5GDA6xl006635 for ; Wed, 16 Jun 2010 13:10:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374Ab0FPNKD (ORCPT ); Wed, 16 Jun 2010 09:10:03 -0400 Received: from smtp127.sbc.mail.sp1.yahoo.com ([69.147.65.186]:23749 "HELO smtp127.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750890Ab0FPNKD (ORCPT ); Wed, 16 Jun 2010 09:10:03 -0400 Received: (qmail 15864 invoked from network); 16 Jun 2010 13:10:02 -0000 Received: from adsl-70-231-239-201.dsl.snfc21.sbcglobal.net (nab@70.231.239.201 with plain) by smtp127.sbc.mail.sp1.yahoo.com with SMTP; 16 Jun 2010 06:10:01 -0700 PDT X-Yahoo-SMTP: fzDSGlOswBCWnIOrNw7KwwK1j9PqyNbe5PtLKiS4dDU.UNl_t6bdEZu9tTLW X-YMail-OSG: MoUcyGEVM1m3gdygSwx4K47ahjnSg7DorhN5DcR_OVt3jDl1Z5cIv8DDcSNgV1MRH.H8kQ4_9qRbgWShkOjfPi4Jh_JX3G9IIh5pG9T89eIjGGseuZwuPLrIso30u2rLQqMiwQveBiFCqjXRu9pY1XEUf.24o_v25br4abk0gJzZGtYdFLUBO5L73bbS3YnKz5z8LwhnLgQTsGtcitJ9oluH.FLOIJfoBZeKUvLWadqh4KyG8U.hOe_QwO4FgnUVBV9SG5JDawD.0sr_xlSKapfHZ..QH.3nIEzXhWFuFErFT9ghCwR5TlXVUgoGeFXVT7Anxk2gjikPivoU6rhpAY3yv9qBkeKyK7loJZGXVQAbfQ-- X-Yahoo-Newman-Property: ymail-3 Subject: Re: [Qemu-devel] Re: [PATCH 1/2] [scsi-bus]: Add PR-OUT and PR-IN case for SCSIRequest xfer and xfer_mode setup From: "Nicholas A. Bellinger" To: Kevin Wolf Cc: Gerd Hoffmann , kvm-devel , qemu-devel , Hannes Reinecke , Christoph Hellwig , Paul Brook In-Reply-To: <1276693399.12514.221.camel@haakon2.linux-iscsi.org> 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> Date: Wed, 16 Jun 2010 06:09:59 -0700 Message-Id: <1276693799.12514.226.camel@haakon2.linux-iscsi.org> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 16 Jun 2010 13:10:06 +0000 (UTC) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 75ec74e..7d80405 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -329,6 +329,17 @@ static int scsi_req_length(SCSIRequest *req, uint8_t *cmd) case PERSISTENT_RESERVE_IN: req->cmd.xfer = cmd[8] | (cmd[7] << 8); break; + case MAINTENANCE_OUT: + case MAINTENANCE_IN: + if (req->dev->type != TYPE_ROM) { + /* Used for MI_REPORT_TARGET_PGS, MO_SET_TARGET_PGS et al. */ + req->cmd.xfer = cmd[9] | (cmd[8] << 8) | + (cmd[7] << 16) | (cmd[6] << 24); + } else { + /* GPCMD_REPORT_KEY and GPCMD_SEND_KEY from multi media commands */ + req->cmd.xfer = cmd[9] | (cmd[8] << 8); + } + break; } Do you have a problem with leaving this reassignment in for TYPE_ROM..?