summaryrefslogtreecommitdiffstats
path: root/hw/scsi/scsi-disk.c
diff options
context:
space:
mode:
authorPaolo Bonzini2018-03-08 16:17:59 +0100
committerPaolo Bonzini2018-03-12 16:12:46 +0100
commit4397a018473ae589be959ba93cb491cbd77fe789 (patch)
tree237ee0f3aa16d0805f9f3544d1652dcf9ef7e72f /hw/scsi/scsi-disk.c
parentchardev: tcp: let TLS run on chardev context (diff)
downloadqemu-4397a018473ae589be959ba93cb491cbd77fe789.tar.gz
qemu-4397a018473ae589be959ba93cb491cbd77fe789.tar.xz
qemu-4397a018473ae589be959ba93cb491cbd77fe789.zip
scsi: support NDOB (no data-out buffer) for WRITE SAME commands
A NDOB bit set to one specifies that the disk shall not transfer data from the data-out buffer and shall process the command as if the data-out buffer contained user data set to all zeroes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-disk.c')
-rw-r--r--hw/scsi/scsi-disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index c65c1ce56d..5b7a48f5a5 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -1807,7 +1807,7 @@ static void scsi_disk_emulate_write_same(SCSIDiskReq *r, uint8_t *inbuf)
return;
}
- if (buffer_is_zero(inbuf, s->qdev.blocksize)) {
+ if ((req->cmd.buf[1] & 0x1) || buffer_is_zero(inbuf, s->qdev.blocksize)) {
int flags = (req->cmd.buf[1] & 0x8) ? BDRV_REQ_MAY_UNMAP : 0;
/* The request is used as the AIO opaque value, so add a ref. */