Add a feature to request transparent reconnects without any UA

Normal applications want the current behaviour where we have the library
consume any/all of the UnitAttentions that the target may have queued on the
initial connection, but when we reconnect the session after a failure the
library will pass all the UAs back to the application to process.

Some applications, such as the test suite or really trivial applications
might not want to have to deal with handling of UAs and just "make it work".
Those applications can now request that upon any reconnection of the session
that libiscsi will automatically consume any and all UAs and hide them from
the application.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2015-12-13 14:29:32 -08:00
parent 74fc637eeb
commit 3c44092635
6 changed files with 29 additions and 1 deletions

View File

@@ -769,6 +769,7 @@ suite_init(void)
"error: Failed to login to target for test set-up\n");
return 1;
}
iscsi_set_no_ua_on_reconnect(mp_sds[i]->iscsi_ctx, 1);
}
#ifndef HAVE_CU_SUITEINFO_PSETUPFUNC
/* libcunit version 1 */
@@ -961,6 +962,7 @@ static int connect_scsi_device(struct scsi_device *sdev, const char *initiatorna
if (sdev->iscsi_ctx == NULL) {
return -1;
}
iscsi_set_no_ua_on_reconnect(sdev->iscsi_ctx, 1);
return 0;
}
#ifdef HAVE_SG_IO