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>
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 @@
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 @@
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: