[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7

Mike Christie michaelc at cs.wisc.edu
Sat Apr 7 15:43:32 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 0bf1fab1c040b506e3cb49f7ada8302d5006e79e
Author: Jim Ramsay <jim_ramsay at dell.com>
Date:   Fri Jun 3 11:25:22 2011 -0400

    Add multiple sessions per iface commandline syntax
    
    This accepts the syntax '-m session -r <n> -o new' and creates a new
    session based on the session selected via the '-r' option, by setting
    the 'multiple' flag in the session_rec_t.
    
    Example:
    
      # iscsiadm -m session
      tcp: [4] <portal> <target>
      # iscsiadm -m session -r 4 -o new
      Logging in to [iface: iface0, target: <target>, portal: <portal>] (multiple)
      Login to [iface: iface0, target: <target>, portal: <portal>] successful.
      # iscsiadm -m session
      tcp: [4] <portal> <target>
      tcp: [5] <portal> <target>
    
    Signed-off-by: Jim Ramsay <jim_ramsay at dell.com>

diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 53900a9..b41281a 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -10,7 +10,7 @@ iscsiadm \- open-iscsi administration utility
 \fBiscsiadm\fR \-m node [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-L all,manual,automatic ] [ \-U all,manual,automatic ] [ \-S ] [ [ \-T targetname \-p ip:port \-I iface ] [ \-l | \-u | \-R | \-s] ]
 [ [ \-o operation ]  [ \-n name ] [ \-v value ] [ \-p ip:port ] ]
 
-\fBiscsiadm\fR \-m session [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-r sessionid | sysfsdir [ \-R ] [ \-u | \-s ] ]
+\fBiscsiadm\fR \-m session [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-r sessionid | sysfsdir [ \-R ] [ \-u | \-s | \-o new ] ]
 
 \fBiscsiadm\fR \-m iface [ \-hV ] [ \-d debug_level ] [ \-P printlevel ] [ \-I ifacename ] [ [ \-o  operation  ] [ \-n name ] [ \-v value ] ]
 
@@ -154,7 +154,8 @@ record.
 \fIrecid\fR is the target name and portal (IP:port). In iface mode, the \fIrecid\fR
 is the iface name. In discovery mode, the \fIrecid\fR is the portal and
 discovery type.
-
+.IP
+In session mode, the \fInew\fR operation logs in a new session using the same node database and iface information as the specified session.
 .IP
 In discovery mode, if the \fIrecid\fR and new operation is passed in, but the \fI--discover\fR argument is not, then iscsiadm will only create a discovery record (it will not perform discovery). If the \fI--discover\fR argument is passed in with the portal and discovery type, then iscsiadm will create the discovery record if needed, and it will create records for portals returned by the target that do not yet have a node DB record.
 .IP
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 45b4c00..f2f0281 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -2154,6 +2154,16 @@ main(int argc, char **argv)
 			rec->session.info = info;
 			rec->session.sid = sid;
 
+			/*
+			 * A "new" session means to login a multiple of the
+			 * currently-detected session.
+			 */
+			if (op == OP_NEW) {
+				op = OP_NOOP;
+				do_login = 1;
+				rec->session.multiple = 1;
+			}
+
 			/* drop down to node ops */
 			rc = exec_node_op(op, do_login, do_logout, do_show,
 					  do_rescan, do_stats, info_level,
@@ -2162,6 +2172,12 @@ free_info:
 			free(info);
 			goto out;
 		} else {
+			if (op == OP_NEW) {
+				log_error("session mode: Operation 'new' only "
+					  "allowed with specific session IDs");
+				rc = ISCSI_ERR_INVAL;
+				goto out;
+			}
 			if (do_logout || do_rescan || do_stats) {
 				rc = exec_node_op(op, do_login, do_logout,
 						 do_show, do_rescan, do_stats,

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list