]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
scsi-block: fix direction of BYTCHK test for VERIFY commands
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 3 Jan 2017 17:20:28 +0000 (18:20 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Jan 2017 16:52:35 +0000 (17:52 +0100)
The direction is wrong; scsi_block_is_passthrough returns
false for commands that *can* use sglists.

Reported-by: Zhang Qian <zhangqian@sangfor.com.cn>
Fixes: 8fdc7839e40f43a426bc7e858cf1dbfe315a3804
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-disk.c

index bdd1e5f86c5bb99fd4eed7366613ef675ecb1ccb..c080888413bd25508bf43e01adacba16182bd8b5 100644 (file)
@@ -2701,7 +2701,7 @@ static bool scsi_block_is_passthrough(SCSIDiskState *s, uint8_t *buf)
          * for the number of logical blocks specified in the length
          * field).  For other modes, do not use scatter/gather operation.
          */
-        if ((buf[1] & 6) != 2) {
+        if ((buf[1] & 6) == 2) {
             return false;
         }
         break;