|
|
9ae3a8 |
From 496cf1296786c104f08a04263d59abf701759374 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 20 Jan 2014 12:49:44 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 28/34] scsi-bus: fix transfer length and direction for VERIFY command
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1390222185-24969-2-git-send-email-pbonzini@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 56833
|
|
|
9ae3a8 |
O-Subject: [RHEL 7.0 qemu-kvm PATCH 1/2] scsi-bus: fix transfer length and direction for VERIFY command
|
|
|
9ae3a8 |
Bugzilla: 1035644
|
|
|
9ae3a8 |
RH-Acked-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The amount of bytes to transfer depends on the BYTCHK field.
|
|
|
9ae3a8 |
If any data is transferred, it is sent to the device.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Cc: qemu-stable@nongnu.org
|
|
|
9ae3a8 |
Tested-by: Hervé Poussineau <hpoussin@reactos.org>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit d12ad44cc4cc9142179e64295608611f118b8ad8)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/scsi/scsi-bus.c | 14 +++++++++++++-
|
|
|
9ae3a8 |
1 file changed, 13 insertions(+), 1 deletion(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/scsi/scsi-bus.c | 14 +++++++++++++-
|
|
|
9ae3a8 |
1 files changed, 13 insertions(+), 1 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
|
|
|
9ae3a8 |
index 6733c1a..0f02208 100644
|
|
|
9ae3a8 |
--- a/hw/scsi/scsi-bus.c
|
|
|
9ae3a8 |
+++ b/hw/scsi/scsi-bus.c
|
|
|
9ae3a8 |
@@ -874,7 +874,6 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
|
|
|
9ae3a8 |
case RELEASE:
|
|
|
9ae3a8 |
case ERASE:
|
|
|
9ae3a8 |
case ALLOW_MEDIUM_REMOVAL:
|
|
|
9ae3a8 |
- case VERIFY_10:
|
|
|
9ae3a8 |
case SEEK_10:
|
|
|
9ae3a8 |
case SYNCHRONIZE_CACHE:
|
|
|
9ae3a8 |
case SYNCHRONIZE_CACHE_16:
|
|
|
9ae3a8 |
@@ -891,6 +890,16 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
|
|
|
9ae3a8 |
case ALLOW_OVERWRITE:
|
|
|
9ae3a8 |
cmd->xfer = 0;
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
+ case VERIFY_10:
|
|
|
9ae3a8 |
+ case VERIFY_12:
|
|
|
9ae3a8 |
+ case VERIFY_16:
|
|
|
9ae3a8 |
+ if ((buf[1] & 2) == 0) {
|
|
|
9ae3a8 |
+ cmd->xfer = 0;
|
|
|
9ae3a8 |
+ } else if ((buf[1] & 4) == 1) {
|
|
|
9ae3a8 |
+ cmd->xfer = 1;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+ cmd->xfer *= dev->blocksize;
|
|
|
9ae3a8 |
+ break;
|
|
|
9ae3a8 |
case MODE_SENSE:
|
|
|
9ae3a8 |
break;
|
|
|
9ae3a8 |
case WRITE_SAME_10:
|
|
|
9ae3a8 |
@@ -1088,6 +1097,9 @@ static void scsi_cmd_xfer_mode(SCSICommand *cmd)
|
|
|
9ae3a8 |
case WRITE_VERIFY_12:
|
|
|
9ae3a8 |
case WRITE_16:
|
|
|
9ae3a8 |
case WRITE_VERIFY_16:
|
|
|
9ae3a8 |
+ case VERIFY_10:
|
|
|
9ae3a8 |
+ case VERIFY_12:
|
|
|
9ae3a8 |
+ case VERIFY_16:
|
|
|
9ae3a8 |
case COPY:
|
|
|
9ae3a8 |
case COPY_VERIFY:
|
|
|
9ae3a8 |
case COMPARE:
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|