From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Khmqj-0006bG-3n for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:57:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Khmqi-0006au-BT for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:57:16 -0400 Received: from [199.232.76.173] (port=40107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khmqi-0006al-8W for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:57:16 -0400 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:59655) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Khmqh-0002KO-5K for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:57:15 -0400 Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id A45DF1A196A for ; Mon, 22 Sep 2008 16:57:06 +0200 (CEST) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07593-04 for ; Mon, 22 Sep 2008 16:57:03 +0200 (CEST) Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 640BC1A1959 for ; Mon, 22 Sep 2008 16:57:03 +0200 (CEST) Received: from [129.183.101.63] (frecb007144.frec.bull.fr [129.183.101.63]) by cyclope.frec.bull.fr (Postfix) with ESMTP id 8D1662728D for ; Mon, 22 Sep 2008 16:57:00 +0200 (CEST) From: Laurent Vivier Content-Type: text/plain; charset=UTF-8 Date: Mon, 22 Sep 2008 16:57:09 +0200 Message-Id: <1222095429.4151.12.camel@frecb07144> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] scsi-generic: correct 6-bytes commands transfer length Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" According to SCSI documentation, for 6 bytes commands (READ(6), WRITE(6)), if transfer length is 0 it specifies 256 blocks. Signed-off-by: Laurent Vivier --- hw/scsi-generic.c | 3 +++ 1 file changed, 3 insertions(+) Index: qemu/hw/scsi-generic.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- qemu.orig/hw/scsi-generic.c 2008-09-22 10:47:07.000000000 +0200 +++ qemu/hw/scsi-generic.c 2008-09-22 14:32:22.000000000 +0200 @@ -352,6 +352,9 @@ static int scsi_length(uint8_t *cmd, int case 0: *len =3D cmd[4]; *cmdlen =3D 6; + /* length 0 means 256 blocks */ + if (*len =3D=3D 0) + *len =3D 256; break; case 1: case 2: --=20 ----------------- Laurent.Vivier@bull.net ------------------ "La perfection est atteinte non quand il ne reste rien =C3=A0 ajouter mais quand il ne reste rien =C3=A0 enlever." Saint Exup=C3=A9ry