Module Name:    src
Committed By:   sborrill
Date:           Mon Feb 21 17:24:20 UTC 2011

Modified Files:
        src/external/bsd/iscsi/dist/src/initiator: iscsi-initiator.8
            iscsi-initiator.c

Log Message:
Remove hostname from pathname to storage in mount point.
This means /mnt/mytarget.domain.local/target0/storage is now
/mnt/target0/storage.

Rationale is as follows:
- The hostname used may vary (i.e. name vs FQDN vs IP) which can mess up
  mountpoints (especially across multiple hosts e.g. in a shared xen pool)
- Target name is given in the mount anyway so it is redundant

OK agc@


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
    src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8
cvs rdiff -u -r1.4 -r1.5 \
    src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.3 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.4
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8:1.3	Tue Aug  3 10:24:39 2010
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.8	Mon Feb 21 17:24:19 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: iscsi-initiator.8,v 1.3 2010/08/03 10:24:39 sborrill Exp $
+.\" $NetBSD: iscsi-initiator.8,v 1.4 2011/02/21 17:24:19 sborrill Exp $
 .\"
 .\" Copyright © 2007 Alistair Crooks.  All rights reserved.
 .\"
@@ -26,7 +26,7 @@
 .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 3, 2010
+.Dd February 21, 2011
 .Dt ISCSI-INITIATOR 8
 .Os
 .Sh NAME
@@ -120,7 +120,7 @@
 .Sh EXAMPLES
 .Bd -literal
 # ./iscsi-initiator -u agc -h iscsi-target0.alistaircrooks.co.uk /mnt
-# ls -al /mnt/iscsi-target0.alistaircrooks.co.uk/target0
+# ls -al /mnt/target0
 total 576
 drwxr-xr-x  2 agc  agc        512 May 11 22:24 .
 drwxr-xr-x  2 agc  agc        512 May 11 22:24 ..

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.4 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.5
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.4	Sun Nov  8 15:33:21 2009
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c	Mon Feb 21 17:24:19 2011
@@ -718,36 +718,31 @@
 		tv.v[tv.c].serial = strdup((char *)&data[4]);
 
 		/* create the tree using virtdir routines */
-		cc = snprintf(name, sizeof(name), "/%s/%s", host, colon);
+		cc = snprintf(name, sizeof(name), "/%s", colon);
 		virtdir_add(&iscsi, name, cc, 'd', name, cc);
-		cc = snprintf(name, sizeof(name), "/%s/%s/storage", host,
-				colon);
+		cc = snprintf(name, sizeof(name), "/%s/storage", colon);
 		virtdir_add(&iscsi, name, cc, devtype, (void *)&sti,
 				sizeof(sti));
-		cc = snprintf(name, sizeof(name), "/%s/%s/hostname", host,
-				colon);
+		cc = snprintf(name, sizeof(name), "/%s/hostname", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tinfo.name,
 				strlen(tinfo.name));
-		cc = snprintf(name, sizeof(name), "/%s/%s/ip", host, colon);
+		cc = snprintf(name, sizeof(name), "/%s/ip", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tinfo.ip, strlen(tinfo.ip));
-		cc = snprintf(name, sizeof(name), "/%s/%s/targetname", host,
-				colon);
+		cc = snprintf(name, sizeof(name), "/%s/targetname", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tinfo.TargetName,
 				strlen(tinfo.TargetName));
-		cc = snprintf(name, sizeof(name), "/%s/%s/vendor", host, colon);
+		cc = snprintf(name, sizeof(name), "/%s/vendor", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tv.v[tv.c].vendor,
 				strlen(tv.v[tv.c].vendor));
-		cc = snprintf(name, sizeof(name), "/%s/%s/product", host,
-				colon);
+		cc = snprintf(name, sizeof(name), "/%s/product", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tv.v[tv.c].product,
 				strlen(tv.v[tv.c].product));
-		cc = snprintf(name, sizeof(name), "/%s/%s/version", host,
-				colon);
+		cc = snprintf(name, sizeof(name), "/%s/version", colon);
 		virtdir_add(&iscsi, name, cc, 'l', tv.v[tv.c].version,
 				strlen(tv.v[tv.c].version));
 		if (tv.v[tv.c].serial[0] && tv.v[tv.c].serial[0] != ' ') {
-			cc = snprintf(name, sizeof(name), "/%s/%s/serial",
-				host, colon);
+			cc = snprintf(name, sizeof(name), "/%s/serial",
+				colon);
 			virtdir_add(&iscsi, name, cc, 'l', tv.v[tv.c].serial,
 				strlen(tv.v[tv.c].serial));
 		}

Reply via email to