qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent.Vivier@bull.net>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] scsi-generic: correct 6-bytes commands transfer length
Date: Mon, 22 Sep 2008 16:57:09 +0200	[thread overview]
Message-ID: <1222095429.4151.12.camel@frecb07144> (raw)

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 <Laurent.Vivier@bull.net>
---
 hw/scsi-generic.c |    3 +++
 1 file changed, 3 insertions(+)

Index: qemu/hw/scsi-generic.c
===================================================================
--- 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 = cmd[4];
         *cmdlen = 6;
+        /* length 0 means 256 blocks */
+        if (*len == 0)
+            *len = 256;
         break;
     case 1:
     case 2:
-- 
----------------- Laurent.Vivier@bull.net  ------------------
  "La perfection est atteinte non quand il ne reste rien à
ajouter mais quand il ne reste rien à enlever." Saint Exupéry

             reply	other threads:[~2008-09-22 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 14:57 Laurent Vivier [this message]
2008-09-22 15:29 ` [Qemu-devel] [PATCH] scsi-generic: correct 6-bytes commands transfer length Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1222095429.4151.12.camel@frecb07144 \
    --to=laurent.vivier@bull.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).