scsi-disk: Fail medium writes with proper sense for readonly LUNs
Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this errorfor any WRITE*/WRITE_VERIFY* calls if the device is readonly=on,i.e. write-protected
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>...
scsi-disk: fix changeable values for MODE_PAGE_R_W_ERROR
The changeable values were not all-zeros for this mode page, fix it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi-disk: parse MODE SELECT commands and parameters
This adds the bulk of the parsing code for MODE SELECT, includingbreaking out changes to different mode pages, and checking that onlychangeable values are modified.
In order to report errors correctly two passes are made through the...
scsi-disk: support toggling the write cache
Finally, this uses the "plumbing" in the previous patch toadd support for toggling the WCE bit of the caching mode page.
scsi-disk: rd/wr/vr-protect !=0 is an error
The QEMU SCSI emulation does not support protection information,so any READ/WRITE/VERIFY commands that has the protect bits set tonon-zero should fail with ILLEGAL_REQUEST/INVALID_FIELD_IN_CDB
From SCSI SBC :...
scsi-disk: improve the lba-out-of-range tests for read/write/verify
Improve the tests for the LBA to cover more cases.
For the 16 byte opcodes, the lba is a uint64, so we need to check is tomake sure that we do not wrap. For example if an opcode would specify...
scsi-disk: split scsi-disk reqops
Only checks for present medium were still done in scsi_send_commandfor emulated commands. So move those to scsi_disk_emulate_commandand return different SCSIReqOps depending on the kind of command.
Checks for present medium can be done unconditionally for the...
scsi-disk: separate read_data/write_data implementation for emulate_reqops
The previous patch only separated the send_command callback.Use different implementations also for read_data and write_data.The latter is still unreachable, so it aborts for now....
scsi-disk: support emulated TO_DEV requests
This adds the implementation of write_data for the emulatedcommand case. The first time through it asks for more data,the second time it finishes the processing of the command.
MODE SELECT and MODE SELECT can now be re-enabled, but they...
scsi-disk: adjust offsets in MODE SENSE by 2
This will make offsets the same when implementing MODE SELECT. This isbecause MODE SELECT has to deal with both 2-byte and 4-byte headers.Unfortunately, this means that the offsets are now off by two compared...
View all revisions | View revisions
Also available in: Atom