[stgt] [PATCH] Add initiator-name directive to the config file

Paul Ryan pajryan at gmail.com
Sat Oct 29 07:26:11 CEST 2011


There is no equivalent config file directive to support the tgtadm
option -Q.  This patch adds support for the new directive in tgt-admin
and documents it

Signed-off-by: Paul Ryan <pajryan at gmail.com>
---
 doc/targets.conf.5.xml |    8 ++++++++
 scripts/tgt-admin      |   10 ++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/doc/targets.conf.5.xml b/doc/targets.conf.5.xml
index c81f8f1..ca63fab 100644
--- a/doc/targets.conf.5.xml
+++ b/doc/targets.conf.5.xml
@@ -194,6 +194,14 @@
         </listitem>
       </varlistentry>
 
+      <varlistentry><term><option>initiator-name <addr></option></term>
+        <listitem>
+          <para>
+	    Allows connections only from the specified initiator name.
+          </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry><term><option>incominguser <user> <userpassword></option></term>
         <listitem>
           <para>
diff --git a/scripts/tgt-admin b/scripts/tgt-admin
index b3e3d90..6a14446 100755
--- a/scripts/tgt-admin
+++ b/scripts/tgt-admin
@@ -750,6 +750,16 @@ sub process_options {
 		}
 	}
 
+	if ($option eq "initiator-name") {
+	        # if we have one command, force it to be an array anyway
+		force_array();
+		my @value_arr = @$value;
+		foreach my $initiator_name (@value_arr) {
+			check_value($initiator_name);
+			execute("tgtadm -C $control_port --lld $driver --op bind --mode target --tid $next_tid -Q $initiator_name");
+		}
+	}
+
 	if ($option =~ m/^MaxRecvDataSegmentLength$|
 			^MaxXmitDataSegmentLength$|
 			^HeaderDigest$|
-- 
1.7.4.1

--
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