diff options
author | trasz <trasz@FreeBSD.org> | 2016-05-06 13:45:42 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2016-05-06 13:45:42 +0000 |
commit | b7e90426c4c55560f8fbd137dbf6f01d6931f6d5 (patch) | |
tree | 5468e9194245d004ef8384478c0abadea83df8aa /usr.bin/iscsictl | |
parent | 353b245ff2b5710dfb4cfc0c2720455b4f346d81 (diff) | |
download | FreeBSD-src-b7e90426c4c55560f8fbd137dbf6f01d6931f6d5.zip FreeBSD-src-b7e90426c4c55560f8fbd137dbf6f01d6931f6d5.tar.gz |
Add the "-r" flag to iscsictl(8).
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin/iscsictl')
-rw-r--r-- | usr.bin/iscsictl/iscsictl.8 | 9 | ||||
-rw-r--r-- | usr.bin/iscsictl/iscsictl.c | 20 |
2 files changed, 25 insertions, 4 deletions
diff --git a/usr.bin/iscsictl/iscsictl.8 b/usr.bin/iscsictl/iscsictl.8 index be3762f..8c1b0ad 100644 --- a/usr.bin/iscsictl/iscsictl.8 +++ b/usr.bin/iscsictl/iscsictl.8 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd May 6, 2016 .Dt ISCSICTL 8 .Os .Sh NAME @@ -39,9 +39,12 @@ .Fl p Ar portal Fl t Ar target .Op Fl u Ar user Fl s Ar secret .Op Fl w Ar timeout +.Op Fl r .Nm .Fl A -.Fl d Ar discovery-host Op Fl u Ar user Fl s Ar secret +.Fl d Ar discovery-host +.Op Fl u Ar user Fl s Ar secret +.Op Fl r .Nm .Fl A .Fl a Op Fl c Ar path @@ -115,6 +118,8 @@ Session ID, as displayed by The "nickname" of session defined in the configuration file. .It Fl p Target portal - host name or address - for statically defined targets. +.It Fl r +Use iSER (iSCSI over RDMA) instead of plain iSCSI over TCP/IP. .It Fl s CHAP secret. .It Fl t diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c index 8bd303d..508e22b 100644 --- a/usr.bin/iscsictl/iscsictl.c +++ b/usr.bin/iscsictl/iscsictl.c @@ -683,7 +683,8 @@ checked_strdup(const char *s) int main(int argc, char **argv) { - int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0; + int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, + rflag = 0, vflag = 0; const char *conf_path = DEFAULT_CONFIG_PATH; char *nickname = NULL, *discovery_host = NULL, *portal = NULL, *target = NULL, *user = NULL, *secret = NULL; @@ -698,7 +699,7 @@ main(int argc, char **argv) argc = xo_parse_args(argc, argv); xo_open_container("iscsictl"); - while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:vw:")) != -1) { + while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:rt:u:s:vw:")) != -1) { switch (ch) { case 'A': Aflag = 1; @@ -737,6 +738,9 @@ main(int argc, char **argv) case 'p': portal = optarg; break; + case 'r': + rflag = 1; + break; case 't': target = optarg; break; @@ -789,6 +793,8 @@ main(int argc, char **argv) xo_errx(1, "-a and -n and mutually exclusive"); if (discovery_host != NULL) xo_errx(1, "-a and -d and mutually exclusive"); + if (rflag != 0) + xo_errx(1, "-a and -r and mutually exclusive"); } else if (nickname != NULL) { if (portal != NULL) xo_errx(1, "-n and -p and mutually exclusive"); @@ -800,6 +806,8 @@ main(int argc, char **argv) xo_errx(1, "-n and -s and mutually exclusive"); if (discovery_host != NULL) xo_errx(1, "-n and -d and mutually exclusive"); + if (rflag != 0) + xo_errx(1, "-n and -r and mutually exclusive"); } else if (discovery_host != NULL) { if (portal != NULL) xo_errx(1, "-d and -p and mutually exclusive"); @@ -844,6 +852,8 @@ main(int argc, char **argv) xo_errx(1, "-n and -s and mutually exclusive"); } + if (rflag != 0) + xo_errx(1, "-r cannot be used with -M"); if (vflag != 0) xo_errx(1, "-v cannot be used with -M"); if (timeout != -1) @@ -875,6 +885,8 @@ main(int argc, char **argv) if (session_id != -1) xo_errx(1, "-i cannot be used with -R"); + if (rflag != 0) + xo_errx(1, "-r cannot be used with -R"); if (vflag != 0) xo_errx(1, "-v cannot be used with -R"); if (timeout != -1) @@ -895,6 +907,8 @@ main(int argc, char **argv) xo_errx(1, "-L and -n and mutually exclusive"); if (discovery_host != NULL) xo_errx(1, "-L and -d and mutually exclusive"); + if (rflag != 0) + xo_errx(1, "-L and -r and mutually exclusive"); if (session_id != -1) xo_errx(1, "-i cannot be used with -L"); @@ -953,6 +967,8 @@ main(int argc, char **argv) targ->t_session_type = SESSION_TYPE_NORMAL; targ->t_address = portal; } + if (rflag != 0) + targ->t_protocol = PROTOCOL_ISER; targ->t_user = user; targ->t_secret = secret; |