diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-07-16 08:53:28 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-07-26 17:44:11 +0200 |
commit | 6a8a685c4d022d4edee57b0fb78c0ae1b4876478 (patch) | |
tree | 8c8c862b9c2b68364f83da87c9d5f61bdca4e884 /hw/scsi.h | |
parent | ba6095cd6b497783e3621606b6b2320781aa3f52 (diff) | |
download | qemu-6a8a685c4d022d4edee57b0fb78c0ae1b4876478.zip qemu-6a8a685c4d022d4edee57b0fb78c0ae1b4876478.tar.gz qemu-6a8a685c4d022d4edee57b0fb78c0ae1b4876478.tar.bz2 |
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>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r-- | hw/scsi.h | 2 |
1 files changed, 2 insertions, 0 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 |