qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] scsi-generic: correct 6-bytes commands transfer length
@ 2008-09-22 14:57 Laurent Vivier
  2008-09-22 15:29 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2008-09-22 14:57 UTC (permalink / raw)
  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 <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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-22 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22 14:57 [Qemu-devel] [PATCH] scsi-generic: correct 6-bytes commands transfer length Laurent Vivier
2008-09-22 15:29 ` Anthony Liguori

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).