mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
scsi-disk: Fail medium writes with proper sense for readonly LUNs
Add sense code for DATA_PROTECT/WRITE_PROTECTED and return this error for any WRITE*/WRITE_VERIFY* calls if the device is readonly=on, i.e. write-protected Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ba6095cd6b
commit
6a8a685c4d
3 changed files with 19 additions and 3 deletions
|
@ -208,6 +208,8 @@ extern const struct SCSISense sense_code_MEDIUM_CHANGED;
|
|||
extern const struct SCSISense sense_code_REPORTED_LUNS_CHANGED;
|
||||
/* Unit attention, Device internal reset */
|
||||
extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET;
|
||||
/* Data Protection, Write Protected */
|
||||
extern const struct SCSISense sense_code_WRITE_PROTECTED;
|
||||
|
||||
#define SENSE_CODE(x) sense_code_ ## x
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue