scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Oct 2011 11:57:06 +0000 (13:57 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 Oct 2011 17:25:51 +0000 (19:25 +0200)
commita21506a011f507c67d0fe4ed244a67b13ea68ebb
treee1e43d3e1c13e777785d97ae74e32b46f73f8dd1
parent3dddd308bdbef01998b52de4c81e940d4fff0cd3
scsi-disk: fail READ CAPACITY if LBA != 0 but PMI == 0

Tested by the Windows Logo Kit SCSI Compliance test. From SBC-3, paragraph
5.25: "The LOGICAL BLOCK ADDRESS field shall be set to zero if the PMI
bit is set to zero. If the PMI bit is set to zero and the LOGICAL BLOCK
ADDRESS field is not set to zero, then the device server shall terminate
the command with CHECK CONDITION status with the sense key set to ILLEGAL
REQUEST and the additional sense code set to INVALID FIELD IN CDB".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/scsi-disk.c