From 8c460269aa77b6c8e434ac57cf66b71aed00ff09 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 2 Jul 2019 11:40:41 +0200 Subject: 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 --- scsi/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'scsi') diff --git a/scsi/utils.c b/scsi/utils.c index 873d49c907..c50e81fdb8 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: -- cgit v1.2.3