[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 13/51] scsi-bus: fix transfer length and direction
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 13/51] scsi-bus: fix transfer length and direction for VERIFY command |
Date: |
Fri, 21 Feb 2014 02:16:49 -0600 |
From: Paolo Bonzini <address@hidden>
The amount of bytes to transfer depends on the BYTCHK field.
If any data is transferred, it is sent to the device.
Cc: address@hidden
Tested-by: Hervé Poussineau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit d12ad44cc4cc9142179e64295608611f118b8ad8)
Signed-off-by: Michael Roth <address@hidden>
---
hw/scsi/scsi-bus.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index ea916d1..2d6ce4d 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -886,7 +886,6 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice
*dev, uint8_t *buf)
case RELEASE:
case ERASE:
case ALLOW_MEDIUM_REMOVAL:
- case VERIFY_10:
case SEEK_10:
case SYNCHRONIZE_CACHE:
case SYNCHRONIZE_CACHE_16:
@@ -903,6 +902,16 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice
*dev, uint8_t *buf)
case ALLOW_OVERWRITE:
cmd->xfer = 0;
break;
+ case VERIFY_10:
+ case VERIFY_12:
+ case VERIFY_16:
+ if ((buf[1] & 2) == 0) {
+ cmd->xfer = 0;
+ } else if ((buf[1] & 4) == 1) {
+ cmd->xfer = 1;
+ }
+ cmd->xfer *= dev->blocksize;
+ break;
case MODE_SENSE:
break;
case WRITE_SAME_10:
@@ -1100,6 +1109,9 @@ static void scsi_cmd_xfer_mode(SCSICommand *cmd)
case WRITE_VERIFY_12:
case WRITE_16:
case WRITE_VERIFY_16:
+ case VERIFY_10:
+ case VERIFY_12:
+ case VERIFY_16:
case COPY:
case COPY_VERIFY:
case COMPARE:
--
1.7.9.5
- [Qemu-stable] [PATCH 02/51] virtio-bus: remove vdev field, (continued)
- [Qemu-stable] [PATCH 02/51] virtio-bus: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 01/51] virtio-ccw: move virtio_ccw_stop_ioeventfd to virtio_ccw_busdev_unplug, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 03/51] virtio-ccw: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 04/51] virtio-pci: remove vdev field, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 07/51] virtio-serial: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 05/51] virtio-bus: cleanup plug/unplug interface, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 08/51] virtio-net: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 10/51] virtio-balloon: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 09/51] virtio-scsi: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 11/51] virtio-rng: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 13/51] scsi-bus: fix transfer length and direction for VERIFY command,
Michael Roth <=
- [Qemu-stable] [PATCH 12/51] virtio-pci: add device_unplugged callback, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 14/51] scsi-disk: fix VERIFY emulation, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 17/51] qom: Split out object and class caches, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 15/51] intel-hda: fix position buffer, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 16/51] memory.c: bugfix - ref counting mismatch in memory_region_find, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 19/51] vl: add missing transition debug->finish_migrate, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 18/51] migration: Fix rate limit, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 20/51] x86: only allow real mode to access 32bit without LMA, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 22/51] split definitions for exec.c and translate-all.c radix trees, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 21/51] qdev-monitor: Avoid device_add crashing on non-device driver name, Michael Roth, 2014/02/21