Commit 72ecb8d9dd339d8c7f3227b25b98b726e3933ebd

Authored by aliguori
1 parent 4f26a486

scsi-generic: correct 6-bytes commands transfer length (Laurent Vivier)

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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5292 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 0 deletions
hw/scsi-generic.c
... ... @@ -352,6 +352,9 @@ static int scsi_length(uint8_t *cmd, int blocksize, int *cmdlen, uint32_t *len)
352 352 case 0:
353 353 *len = cmd[4];
354 354 *cmdlen = 6;
  355 + /* length 0 means 256 blocks */
  356 + if (*len == 0)
  357 + *len = 256;
355 358 break;
356 359 case 1:
357 360 case 2:
... ...