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:
@@ -159,6 +159,7 @@ struct iscsi_context {
|
||||
int scsi_timeout;
|
||||
struct iscsi_context *old_iscsi;
|
||||
int retry_cnt;
|
||||
int no_ua_on_reconnect;
|
||||
};
|
||||
|
||||
#define ISCSI_PDU_IMMEDIATE 0x40
|
||||
|
||||
@@ -1305,6 +1305,12 @@ iscsi_set_bind_interfaces(struct iscsi_context *iscsi, char * interfaces);
|
||||
EXTERN void
|
||||
iscsi_set_reconnect_max_retries(struct iscsi_context *iscsi, int count);
|
||||
|
||||
/* Set to true to have libiscsi use TESTUNITREADY and consume any/all
|
||||
UnitAttentions that may have triggered in the target.
|
||||
*/
|
||||
EXTERN void
|
||||
iscsi_set_no_ua_on_reconnect(struct iscsi_context *iscsi, int state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user