From a5ee9085627eaeb501db31e3758df4e18500be71 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 8 Feb 2012 10:40:37 +0100 Subject: scsi: fix WRITE SAME transfer length and direction Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hw/scsi-disk.c') diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index eca00a6b1d..fbb10415cb 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1566,8 +1566,11 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf) } break; case WRITE_SAME_10: + len = lduw_be_p(&buf[7]); + goto write_same; case WRITE_SAME_16: - len = r->req.cmd.xfer / s->qdev.blocksize; + len = ldl_be_p(&buf[10]) & 0xffffffffULL; + write_same: DPRINTF("WRITE SAME() (sector %" PRId64 ", count %d)\n", r->req.cmd.lba, len); -- cgit v1.2.3