RECONNECT add option to limit the number of reconnect retries

In specific situation it might be useful to give up if a reconnect
is not successful or after a given number reconnect retries.
This patch adds the ability to change that. The default remains
the same: retry forever.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-12-04 13:38:50 +01:00
parent 042a1deb07
commit ee83c7ce75
6 changed files with 61 additions and 29 deletions

View File

@@ -121,6 +121,7 @@ struct iscsi_context {
int lun;
int no_auto_reconnect;
int reconnect_deferred;
int reconnect_max_retries;
int log_level;
iscsi_log_fn log_fn;

View File

@@ -1076,6 +1076,16 @@ iscsi_set_tcp_syncnt(struct iscsi_context *iscsi, int value);
EXTERN void
iscsi_set_bind_interfaces(struct iscsi_context *iscsi, char * interfaces);
/* This function is to set if we should retry a failed reconnect
count is defined as follows:
-1 -> retry forever (default)
0 -> never retry
n -> retry n times
*/
EXTERN void
iscsi_set_reconnect_max_retries(struct iscsi_context *iscsi, int count);
#ifdef __cplusplus
}
#endif