ctladm: deprecate the undocumented "port -l" option

It was mostly removed from the man page in
9c887a4f86, but left in the command.
Fully remove it from the man page, and warn if anybody uses it.  Remove
it entirely for FreeBSD 16.

PR:		279546
MFC after:	2 weeks
Reviewed by:	mav
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D45522
This commit is contained in:
Alan Somers 2024-06-06 15:09:38 -06:00
parent 914c2b3314
commit bb95fbf634
2 changed files with 20 additions and 14 deletions

View file

@ -597,9 +597,7 @@ The serial number is returned when the error is injected.
.El .El
.It Ic port .It Ic port
Perform one of several CTL frontend port operations. Perform one of several CTL frontend port operations.
Either get a list of frontend ports Either create a new frontend port
.Pq Fl l ,
create a new frontend port
.Pq Fl c , .Pq Fl c ,
destroy a frontend port destroy a frontend port
.Pq Fl r , .Pq Fl r ,
@ -614,7 +612,6 @@ for a given port.
One of One of
.Fl c , .Fl c ,
.Fl r , .Fl r ,
.Fl l ,
.Fl o , .Fl o ,
or or
.Fl w .Fl w

View file

@ -184,7 +184,11 @@ static struct ctladm_opts option_table[] = {
{"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:o:s:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:o:s:"},
{"nvlist", CTLADM_CMD_NVLIST, CTLADM_ARG_NONE, "vx"}, {"nvlist", CTLADM_CMD_NVLIST, CTLADM_ARG_NONE, "vx"},
{"nvterminate", CTLADM_CMD_NVTERMINATE, CTLADM_ARG_NONE, "ac:h:"}, {"nvterminate", CTLADM_CMD_NVTERMINATE, CTLADM_ARG_NONE, "ac:h:"},
#if (__FreeBSD_version < 1600000)
{"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:O:d:crp:qt:w:W:x"}, {"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:O:d:crp:qt:w:W:x"},
#else
{"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "o:O:d:crp:t:w:W:"},
#endif
{"portlist", CTLADM_CMD_PORTLIST, CTLADM_ARG_NONE, "f:ilp:qvx"}, {"portlist", CTLADM_CMD_PORTLIST, CTLADM_ARG_NONE, "f:ilp:qvx"},
{"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"},
{"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"},
@ -410,7 +414,9 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
char *driver = NULL; char *driver = NULL;
nvlist_t *option_list; nvlist_t *option_list;
ctl_port_type port_type = CTL_PORT_NONE; ctl_port_type port_type = CTL_PORT_NONE;
#if (__FreeBSD_version < 1600000)
int quiet = 0, xml = 0; int quiet = 0, xml = 0;
#endif
option_list = nvlist_create(0); option_list = nvlist_create(0);
if (option_list == NULL) if (option_list == NULL)
@ -418,12 +424,22 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
while ((c = getopt(argc, argv, combinedopt)) != -1) { while ((c = getopt(argc, argv, combinedopt)) != -1) {
switch (c) { switch (c) {
#if (__FreeBSD_version < 1600000)
case 'l': case 'l':
warnx("ctladm port -l is deprecated. "
"Use ctladm portlist instead");
if (port_mode != CCTL_PORT_MODE_NONE) if (port_mode != CCTL_PORT_MODE_NONE)
goto bailout_badarg; goto bailout_badarg;
port_mode = CCTL_PORT_MODE_LIST; port_mode = CCTL_PORT_MODE_LIST;
break; break;
case 'q':
quiet = 1;
break;
case 'x':
xml = 1;
break;
#endif
case 'c': case 'c':
port_mode = CCTL_PORT_MODE_CREATE; port_mode = CCTL_PORT_MODE_CREATE;
break; break;
@ -483,9 +499,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
case 'p': case 'p':
targ_port = strtol(optarg, NULL, 0); targ_port = strtol(optarg, NULL, 0);
break; break;
case 'q':
quiet = 1;
break;
case 't': { case 't': {
ctladm_optret optret; ctladm_optret optret;
ctladm_cmdargs argnum; ctladm_cmdargs argnum;
@ -529,9 +542,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
wwpn = strtoull(optarg, NULL, 0); wwpn = strtoull(optarg, NULL, 0);
wwpn_set = 1; wwpn_set = 1;
break; break;
case 'x':
xml = 1;
break;
} }
} }
@ -563,6 +573,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
entry.targ_port = targ_port; entry.targ_port = targ_port;
switch (port_mode) { switch (port_mode) {
#if (__FreeBSD_version < 1600000)
case CCTL_PORT_MODE_LIST: { case CCTL_PORT_MODE_LIST: {
char opts[] = "xq"; char opts[] = "xq";
char argx[] = "-x"; char argx[] = "-x";
@ -579,6 +590,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
cctl_portlist(fd, argcx, argvx, opts); cctl_portlist(fd, argcx, argvx, opts);
break; break;
} }
#endif
case CCTL_PORT_MODE_REMOVE: case CCTL_PORT_MODE_REMOVE:
/* FALLTHROUGH */ /* FALLTHROUGH */
case CCTL_PORT_MODE_CREATE: { case CCTL_PORT_MODE_CREATE: {
@ -681,7 +693,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt)
fprintf(stdout, "Front End Ports disabled\n"); fprintf(stdout, "Front End Ports disabled\n");
break; break;
default: default:
warnx("%s: one of -l, -o or -w/-W must be specified", __func__); warnx("%s: one of -c, -r, -o or -w/-W must be specified", __func__);
retval = 1; retval = 1;
goto bailout; goto bailout;
break; break;
@ -4270,7 +4282,6 @@ usage(int error)
"port options:\n" "port options:\n"
"-c : create new ioctl or iscsi frontend port\n" "-c : create new ioctl or iscsi frontend port\n"
"-d : specify ioctl or iscsi frontend type\n" "-d : specify ioctl or iscsi frontend type\n"
"-l : list frontend ports\n"
"-o on|off : turn frontend ports on or off\n" "-o on|off : turn frontend ports on or off\n"
"-O pp|vp : create new frontend port using pp and/or vp\n" "-O pp|vp : create new frontend port using pp and/or vp\n"
"-w wwnn : set WWNN for one frontend\n" "-w wwnn : set WWNN for one frontend\n"
@ -4278,8 +4289,6 @@ usage(int error)
"-t port_type : specify fc, scsi, ioctl, internal frontend type\n" "-t port_type : specify fc, scsi, ioctl, internal frontend type\n"
"-p targ_port : specify target port number\n" "-p targ_port : specify target port number\n"
"-r : remove frontend port\n" "-r : remove frontend port\n"
"-q : omit header in list output\n"
"-x : output port list in XML format\n"
"portlist options:\n" "portlist options:\n"
"-f frontend : specify frontend type\n" "-f frontend : specify frontend type\n"
"-i : report target and initiators addresses\n" "-i : report target and initiators addresses\n"