[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/25] scsi-disk: fix VERIFY for scsi-block
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 21/25] scsi-disk: fix VERIFY for scsi-block |
Date: |
Thu, 22 Dec 2016 16:22:56 +0100 |
When a scsi-disk object receives VERIFY command with BYTCHK bit being zero,
scsi_block_is_passthrough returns false and finally makes req being proceeded
by scsi_block_dma_command. Because scsi_block_dma_command has removed process
of VERIFY, QEMU will abort in this function.
Reported-by: Junlian Bell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/scsi-disk.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index a963191..bdd1e5f 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2157,6 +2157,13 @@ static int32_t scsi_disk_dma_command(SCSIRequest *req,
uint8_t *buf)
DPRINTF("Write %s(sector %" PRId64 ", count %u)\n",
(command & 0xe) == 0xe ? "And Verify " : "",
r->req.cmd.lba, len);
+ case VERIFY_10:
+ case VERIFY_12:
+ case VERIFY_16:
+ /* We get here only for BYTCHK == 0x01 and only for scsi-block.
+ * As far as DMA is concerned, we can treat it the same as a write;
+ * scsi_block_do_sgio will send VERIFY commands.
+ */
if (r->req.cmd.buf[1] & 0xe0) {
goto illegal_request;
}
@@ -2712,7 +2719,7 @@ static bool scsi_block_is_passthrough(SCSIDiskState *s,
uint8_t *buf)
case WRITE_VERIFY_16:
/* MMC writing cannot be done via DMA helpers, because it sometimes
* involves writing beyond the maximum LBA or to negative LBA
(lead-in).
- * We might use scsi_disk_dma_reqops as long as no writing commands are
+ * We might use scsi_block_dma_reqops as long as no writing commands
are
* seen, but performance usually isn't paramount on optical media. So,
* just make scsi-block operate the same as scsi-generic for them.
*/
--
2.9.3
- [Qemu-devel] [PULL 11/25] timer: fix misleading comment in timer.h, (continued)
- [Qemu-devel] [PULL 11/25] timer: fix misleading comment in timer.h, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 12/25] main-loop: update comment for qemu_mutex_lock/unlock_iothread, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 13/25] block: drop remaining legacy aio functions in comment, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 15/25] pc: make smbus configurable, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 17/25] pc: make pit configurable, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 14/25] target-i386: Add Intel SHA_NI instruction support., Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 16/25] pc: make sata configurable, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 19/25] multiboot: copy the cmdline verbatim, unescape module strings, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 20/25] hw/block/pflash_cfi*.c: fix confusing assert fail message, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 18/25] x86: Fix x86_64 'g' packet response to gdb from 32-bit mode., Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 21/25] scsi-disk: fix VERIFY for scsi-block,
Paolo Bonzini <=
- [Qemu-devel] [PULL 22/25] kvm: sync linux headers, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 24/25] target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 23/25] kvmclock: reduce kvmclock difference on migration, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 25/25] x86: implement la57 paging mode, Paolo Bonzini, 2016/12/22
- Re: [Qemu-devel] [PULL 00/25] First round of misc patches for QEMU 2.9, no-reply, 2016/12/22
- Re: [Qemu-devel] [PULL 00/25] First round of misc patches for QEMU 2.9, Peter Maydell, 2016/12/23