From 32cfd3c2f8c14ffd865bef69e5d8dfe906380d8e Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 13 Dec 2017 16:23:25 -0500 Subject: [PATCH] Make iscsi_set_noautoreconnect public In our use at Datto, we have come across several issues related to the automatic reconnect logic (mainly its interaction with POLLHUP). This allows us to disable the functionality, at the expense of writing our own reconnect logic. Related: #241 --- include/iscsi-private.h | 2 -- include/iscsi.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/iscsi-private.h b/include/iscsi-private.h index 218cf74..a96caae 100644 --- a/include/iscsi-private.h +++ b/include/iscsi-private.h @@ -350,8 +350,6 @@ uint32_t crc32c(uint8_t *buf, int len); struct scsi_task *iscsi_scsi_get_task_from_pdu(struct iscsi_pdu *pdu); -void iscsi_set_noautoreconnect(struct iscsi_context *iscsi, int state); - void iscsi_decrement_iface_rr(void); #define ISCSI_LOG(iscsi, level, format, ...) \ diff --git a/include/iscsi.h b/include/iscsi.h index 63fa94b..da3fb76 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -1595,6 +1595,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 disable auto reconnect logic. + * + * 0 - Disable this feature (auto reconnect) + * 1 - Enable this feature (no auto reconnect) + */ +EXTERN void +iscsi_set_noautoreconnect(struct iscsi_context *iscsi, int state); + + /* This function is to set if we should retry a failed reconnect count is defined as follows: