From 801bfb342dded5bd6bbcf649059066e330590882 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 11 Jul 2012 15:33:32 +1000 Subject: [PATCH] Login: dont fail the login just because there is no media in a device in that case we will never reach test unit ready being successful since it will fail with NOT_READY/MEDIUM_NOT_PRESENT. Treat this sense code as a successful login as far as the login process is concerned --- lib/connect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/connect.c b/lib/connect.c index 15ec1be..62591fe 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -63,6 +63,13 @@ iscsi_testunitready_cb(struct iscsi_context *iscsi, int status, } } + /* Dont fail the login just because there is no medium in the device */ + if (status != 0 + && task->sense.key == SCSI_SENSE_NOT_READY + && task->sense.ascq == SCSI_SENSE_ASCQ_MEDIUM_NOT_PRESENT) { + status = 0; + } + ct->cb(iscsi, status?SCSI_STATUS_ERROR:SCSI_STATUS_GOOD, NULL, ct->private_data); free(ct);