From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Kevin Wolf 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> Subject: [Qemu-devel] [STABLE 0.13][PATCH 01/13] scsi-disk: fix the mode data length field returned by the MODE SENSE command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@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; -- 1.7.2.2