From patchwork Mon Aug 2 15:31:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Kohl X-Patchwork-Id: 60546 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 153D3B6EF0 for ; Tue, 3 Aug 2010 01:36:40 +1000 (EST) Received: from localhost ([127.0.0.1]:39819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ofx49-0002dU-3k for incoming@patchwork.ozlabs.org; Mon, 02 Aug 2010 11:36:37 -0400 Received: from [140.186.70.92] (port=42407 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ofwzh-0000jt-6S for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:32:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ofwzf-0001Jq-7T for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:32:00 -0400 Received: from demumfd002.nsn-inter.net ([93.183.12.31]:11059) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ofwze-0001JV-R5 for qemu-devel@nongnu.org; Mon, 02 Aug 2010 11:31:59 -0400 Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd002.nsn-inter.net (8.12.11.20060308/8.12.11) with ESMTP id o72FVvK5024342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Aug 2010 17:31:57 +0200 Received: from localhost.localdomain ([10.148.23.89]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id o72FVmET012299; Mon, 2 Aug 2010 17:31:57 +0200 From: Bernhard Kohl To: qemu-devel@nongnu.org Date: Mon, 2 Aug 2010 17:31:26 +0200 Message-Id: <1280763089-11829-2-git-send-email-bernhard.kohl@nsn.com> X-Mailer: git-send-email 1.7.2 In-Reply-To: <1280763089-11829-1-git-send-email-bernhard.kohl@nsn.com> References: <1280763089-11829-1-git-send-email-bernhard.kohl@nsn.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Bernhard Kohl Subject: [Qemu-devel] [PATCH 1/4] scsi-disk: fix the mode data length field returned by the MODE SENSE command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The MODE DATA LENGTH field indicates the length in bytes of the following data that is available to be transferred. The mode data length does not include the number of bytes in the MODE DATA LENGTH field. Signed-off-by: Bernhard Kohl --- hw/scsi-disk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index f43f2d0..57439f4 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -652,7 +652,7 @@ static int scsi_disk_emulate_mode_sense(SCSIRequest *req, uint8_t *outbuf) } buflen = p - outbuf; - outbuf[0] = buflen - 4; + outbuf[0] = buflen - 1; if (buflen > req->cmd.xfer) buflen = req->cmd.xfer; return buflen;