summaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-19 17:19:21 +0200
committerKevin Wolf <kwolf@redhat.com>2011-10-28 19:25:50 +0200
commit7e218df5181f1c26d52ef525b30a416c60a2160b (patch)
tree08135b6495c7a74f4b6306d2a3d6018cb86bfdfc /hw/scsi-disk.c
parentd99902287c0c57219b3b33c713f14d55124b0002 (diff)
scsi: pass correct sense code for ENOMEDIUM
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 69095780ac..9c62569a17 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -231,6 +231,9 @@ static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type)
bdrv_iostatus_set_err(s->bs, error);
} else {
switch (error) {
+ case ENOMEDIUM:
+ scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));
+ break;
case ENOMEM:
scsi_check_condition(r, SENSE_CODE(TARGET_FAILURE));
break;