From patchwork Mon Sep 13 12:42:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 64592 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 54FDEB70A4 for ; Mon, 13 Sep 2010 22:51:54 +1000 (EST) Received: from localhost ([127.0.0.1]:44460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov8Vj-0006GP-Hb for incoming@patchwork.ozlabs.org; Mon, 13 Sep 2010 08:51:51 -0400 Received: from [140.186.70.92] (port=55192 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov8Mo-00006u-OD for qemu-devel@nongnu.org; Mon, 13 Sep 2010 08:42:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov8Mm-0004IE-Eb for qemu-devel@nongnu.org; Mon, 13 Sep 2010 08:42:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10302) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov8Mm-0004I6-4t for qemu-devel@nongnu.org; Mon, 13 Sep 2010 08:42:36 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8DCgYP3007258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Sep 2010 08:42:34 -0400 Received: from dhcp-5-188.str.redhat.com (vpn2-9-36.ams2.redhat.com [10.36.9.36]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8DCgUmF027971; Mon, 13 Sep 2010 08:42:33 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 13 Sep 2010 14:42:39 +0200 Message-Id: <1284381771-7333-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1284381771-7333-1-git-send-email-kwolf@redhat.com> References: <1284381771-7333-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [STABLE 0.13][PATCH 01/13] 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 From: Bernhard Kohl 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 Signed-off-by: Kevin Wolf (cherry picked from commit 78e70c30612833fd0017cfa5b519bc23df808927) --- 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;