aboutsummaryrefslogtreecommitdiff
path: root/scsi
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-07-02 11:40:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-07-15 11:20:42 +0200
commit8c460269aa77b6c8e434ac57cf66b71aed00ff09 (patch)
tree0bff21a87e359779dccb59a2bcb41615a3d0d9c8 /scsi
parent00e3cccdf413eb1093d8e9f26588da0fc82fa55f (diff)
downloadqemu-8c460269aa77b6c8e434ac57cf66b71aed00ff09.zip
qemu-8c460269aa77b6c8e434ac57cf66b71aed00ff09.tar.gz
qemu-8c460269aa77b6c8e434ac57cf66b71aed00ff09.tar.bz2
iscsi: base all handling of check condition on scsi_sense_to_errno
Now that scsi-disk is not using scsi_sense_to_errno to separate guest-recoverable sense codes, we can modify it to simplify iscsi's own sense handling. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scsi')
-rw-r--r--scsi/utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/scsi/utils.c b/scsi/utils.c
index 873d49c..c50e81f 100644
--- a/scsi/utils.c
+++ b/scsi/utils.c
@@ -379,8 +379,7 @@ int scsi_sense_to_errno(int key, int asc, int ascq)
case NO_SENSE:
case RECOVERED_ERROR:
case UNIT_ATTENTION:
- /* These sense keys are not errors */
- return 0;
+ return EAGAIN;
case ABORTED_COMMAND: /* COMMAND ABORTED */
return ECANCELED;
case NOT_READY:
@@ -409,7 +408,7 @@ int scsi_sense_to_errno(int key, int asc, int ascq)
case 0x2700: /* WRITE PROTECTED */
return EACCES;
case 0x0401: /* NOT READY, IN PROGRESS OF BECOMING READY */
- return EAGAIN;
+ return EINPROGRESS;
case 0x0402: /* NOT READY, INITIALIZING COMMAND REQUIRED */
return ENOTCONN;
default: