diff options
author | Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> | 2018-03-27 18:14:51 -0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-04-09 16:36:39 +0200 |
commit | 29e560f00e2bc1b5731c8276031aaf192de55d9d (patch) | |
tree | ccf15f0d81a685fc487656cfda6e8da44e207de0 /hw/dma | |
parent | 2343be0d7ee8a6e02c2bf99d0243492085c8d399 (diff) | |
download | qemu-29e560f00e2bc1b5731c8276031aaf192de55d9d.zip qemu-29e560f00e2bc1b5731c8276031aaf192de55d9d.tar.gz qemu-29e560f00e2bc1b5731c8276031aaf192de55d9d.tar.bz2 |
hw/scsi: support SCSI-2 passthrough without PI
QEMU SCSI code makes assumptions about how the PROTECT and BYTCHK
works in the protocol, denying support for PI (Protection
Information) in case the guest OS requests it. However, in SCSI versions 2
and older, there is no PI concept in the protocol.
This means that when dealing with such devices:
- there is no PROTECT bit in byte 5 of the standard INQUIRY response. The
whole byte is marked as "Reserved";
- there is no RDPROTECT in byte 2 of READ. We have 'Logical Unit Number'
in this field instead;
- there is no VRPROTECT in byte 2 of VERIFY. We have 'Logical Unit Number'
in this field instead. This also means that the BYTCHK bit in this case
is not related to PI.
Since QEMU does not consider these changes, a SCSI passthrough using
a SCSI-2 device will not work. It will mistake these fields with
PI information and return Illegal Request SCSI SENSE thinking
that the driver is asking for PI support.
This patch fixes it by adding a new attribute called 'scsi_version'
that is read from the standard INQUIRY response of passthrough
devices. This allows for a version verification before applying
conditions related to PI that doesn't apply for older versions.
Reported-by: Dac Nguyen <dacng@us.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Message-Id: <20180327211451.14647-1-danielhb@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/dma')
0 files changed, 0 insertions, 0 deletions