[stgt] [PATCH 2/5] Add RedirectCallback parameter to target

Chandra Seetharaman sekharan at us.ibm.com
Tue Sep 21 03:41:04 CEST 2010


Add support for a new target parameter RedirectCallback to set the
external program to be invoked for getting a RedirectAddress.

Signed-Off-By: Chandra Seetharaman <sekharan at us.ibm.com>
---
 usr/iscsi/iscsid.h |    1 +
 usr/iscsi/target.c |    7 +++++++
 2 files changed, 8 insertions(+)

Index: tgt-1.0.8/usr/iscsi/target.c
===================================================================
--- tgt-1.0.8.orig/usr/iscsi/target.c
+++ tgt-1.0.8/usr/iscsi/target.c
@@ -419,6 +419,13 @@ int iscsi_target_update(int mode, int op
 				err = TGTADM_SUCCESS;
 			} else
 				break;
+		} else if (!strncmp(name, "RedirectCallback", 16)) {
+			target->redirect_info.callback = strdup(str);
+			if (!target->redirect_info.callback) {
+				err = TGTADM_NOMEM;
+				break;
+			}
+			err = TGTADM_SUCCESS;
 		}
 
 		idx = param_index_by_name(name, session_keys);
Index: tgt-1.0.8/usr/iscsi/iscsid.h
===================================================================
--- tgt-1.0.8.orig/usr/iscsi/iscsid.h
+++ tgt-1.0.8/usr/iscsi/iscsid.h
@@ -248,6 +248,7 @@ struct iscsi_target {
 		char addr[NI_MAXHOST + 1];
 		char port[NI_MAXSERV + 1];
 		uint8_t reason;
+		char	*callback;
 	} redirect_info;
 
 	struct list_head isns_list;
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list