The transfer length for these commands is different from the transfer length of the corresponding disk commands, so parse it specially.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- READ REVERSE(16) seems to be for people who stream manga from tape. hw/scsi-bus.c | 10 ++++++++++ hw/scsi-defs.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 5fbf8db..46cd1f9 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -891,6 +891,16 @@ static int scsi_req_stream_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *bu cmd->xfer *= dev->blocksize; } break; + case READ_16: + case READ_REVERSE_16: + case VERIFY_16: + case WRITE_16: + cmd->len = 16; + cmd->xfer = buf[14] | (buf[13] << 8) | (buf[12] << 16); + if (buf[1] & 0x01) { /* fixed */ + cmd->xfer *= dev->blocksize; + } + break; case REWIND: case START_STOP: cmd->len = 6; diff --git a/hw/scsi-defs.h b/hw/scsi-defs.h index ca24192..219c84d 100644 --- a/hw/scsi-defs.h +++ b/hw/scsi-defs.h @@ -92,6 +92,7 @@ #define PERSISTENT_RESERVE_OUT 0x5f #define VARLENGTH_CDB 0x7f #define WRITE_FILEMARKS_16 0x80 +#define READ_REVERSE_16 0x81 #define ALLOW_OVERWRITE 0x82 #define EXTENDED_COPY 0x83 #define ATA_PASSTHROUGH 0x85 -- 1.7.9.3