summaryrefslogtreecommitdiff
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-07-16 08:53:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-07-26 17:44:11 +0200
commit6a8a685c4d022d4edee57b0fb78c0ae1b4876478 (patch)
tree8c8c862b9c2b68364f83da87c9d5f61bdca4e884 /hw/scsi.h
parentba6095cd6b497783e3621606b6b2320781aa3f52 (diff)
downloadqemu-6a8a685c4d022d4edee57b0fb78c0ae1b4876478.tar.gz
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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index e2fb8a4870..fc9dc50e43 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -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