Rework error messages generated when login fails to not repeat the same
thing "Failed to login to target" several times as the error cascades up through the layers of callbacks.
This commit is contained in:
@@ -67,8 +67,6 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
|
||||
struct connect_task *ct = private_data;
|
||||
|
||||
if (status != 0) {
|
||||
iscsi_set_error(iscsi, "Failed to login to iSCSI target. "
|
||||
"%s", iscsi_get_error(iscsi));
|
||||
ct->cb(iscsi, SCSI_STATUS_ERROR, NULL, ct->private_data);
|
||||
free(ct);
|
||||
return;
|
||||
|
||||
@@ -217,7 +217,7 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
|
||||
if (iscsi_full_connect_sync(iscsi, iscsi_url->portal, iscsi_url->lun) != 0) {
|
||||
fprintf(stderr, "Failed to log in to target %s\n", iscsi_get_error(iscsi));
|
||||
fprintf(stderr, "Login Failed. %s\n", iscsi_get_error(iscsi));
|
||||
iscsi_destroy_url(iscsi_url);
|
||||
iscsi_destroy_context(iscsi);
|
||||
exit(10);
|
||||
|
||||
@@ -239,7 +239,7 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v
|
||||
void discoverylogin_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
|
||||
{
|
||||
if (status != 0) {
|
||||
fprintf(stderr, "Failed to log in to target. : %s\n", iscsi_get_error(iscsi));
|
||||
fprintf(stderr, "Login failed. %s\n", iscsi_get_error(iscsi));
|
||||
exit(10);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user