aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-04-19 20:41:16 +1000
committerPaolo Bonzini <pbonzini@redhat.com>2012-04-19 16:16:05 +0200
commitc9e4d8284e1f3205aa3c05dc18932f9ca2c05f53 (patch)
tree74efb950a367799f5a41d7147d362f6350517fd8 /hw/scsi-disk.c
parent6a2de0f2038349716049c9b9a972d6777c85424b (diff)
SCSI emulation: Support unmap via WRITE_SAME_10.
This was added in SBC r26 in place of the reserved bits that were present up to that version. It is the same as WRITE_SAME_16 as far as QEMU is concerned. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index fca31fa6e7..85a75c4b29 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -627,7 +627,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
{
outbuf[3] = buflen = 8;
outbuf[4] = 0;
- outbuf[5] = 0x40; /* write same with unmap supported */
+ outbuf[5] = 0x60; /* write_same 10/16 supported */
outbuf[6] = 0;
outbuf[7] = 0;
break;
@@ -1558,10 +1558,11 @@ static int32_t scsi_send_command(SCSIRequest *req, uint8_t *buf)
goto illegal_lba;
}
break;
+ case WRITE_SAME_10:
case WRITE_SAME_16:
len = r->req.cmd.xfer / s->qdev.blocksize;
- DPRINTF("WRITE SAME(16) (sector %" PRId64 ", count %d)\n",
+ DPRINTF("WRITE SAME() (sector %" PRId64 ", count %d)\n",
r->req.cmd.lba, len);
if (r->req.cmd.lba > s->qdev.max_lba) {