[stgt] [PATCH 3/3] Register existing targets when iSNS is enabled

Chandra Seetharaman sekharan at us.ibm.com
Wed Aug 4 03:16:51 CEST 2010


If targets are first defined and iSNS is enabled later, go ahead
and register all defined targets at once.

Signed-Off-By: Chandra Seetharaman <sekharan at us.ibm.com>
---
 usr/iscsi/isns.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: tgt-469b574/usr/iscsi/isns.c
===================================================================
--- tgt-469b574.orig/usr/iscsi/isns.c
+++ tgt-469b574/usr/iscsi/isns.c
@@ -896,6 +896,7 @@ int isns_init(void)
 	int err;
 	char port[8];
 	struct addrinfo hints, *res;
+	struct iscsi_target *target;
 
 	snprintf(port, sizeof(port), "%d", isns_port);
 	memset(&hints, 0, sizeof(hints));
@@ -923,6 +924,10 @@ int isns_init(void)
 
 	use_isns = 1;
 
+	if (!num_targets)
+		list_for_each_entry(target, &iscsi_targets_list, tlist)
+			isns_target_register(tgt_targetname(target->tid));
+
 	return 0;
 }
 
--
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