From nobody Thu Sep 19 20:07:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X8ml37358z5XJLM; Thu, 19 Sep 2024 20:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8ml35g4Dz4SmJ; Thu, 19 Sep 2024 20:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwH+gLnn3PQnd1xwdedVZgi8d3RSyB96ZELzRzcywyc=; b=fDssBiSFq+NyeV6Xs8lrBeaR80/Q4XTTnYP1z/veGcNLZ6EpxDTwxf+EIO9nG2AN7Z+Pau 5EJx/mtDHiRcmNbOoB/0OJW3m6tVMuei26lyXQKBeWbS8oRKvVyE+HzMApYWuFPrUrpCLt E2OuXk6Jz7UIYQVW+SUIWrcDVu8k8W97R0ht2hHt6jtEl6oE2WRrr+0nW6QvYZnpH4nkt3 QkVYlxgErso78elz/BtESfu0MZxgqJ9VeyI3UI/PU2J5eVx+Mphmx0Of1i0lMGxVvDsZ7V rcsIv4aJMVjTQfJxtNuJ7+sWQgpwKVUlyt268nxn74mP2w2XKbba0UEyUfXUQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726776431; a=rsa-sha256; cv=none; b=QTdB9t13u8auKfMugoDbAKCopUwiPCtNpihza3/w1AaZidjY/RP+gFzTDtAspgTTagOkxP Mbf+BmRK/wf3J/yZpvie+ij4cSpgndoUxzisZO36f4ZALjjszjOqYbTt2CJvP/WFkvF67Y cfB7vt1cNxCXJM+9lpSvIQjsWKqWTP8TOQUxLXYpheBAVX31ZkKRM/TZDyiFyonaepPMSh RV3xqsb7AHcSEFOYp6jg17KiP0ajQab7dDH2BOBo9vLjVPxfqiGf/TqpExEi20raJ5XOAz 2GiLnQTWk520KDHz/qfeSA0rKO/dtW5nof56d+rqMkLSynCwNJM88MZavP14Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726776431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwH+gLnn3PQnd1xwdedVZgi8d3RSyB96ZELzRzcywyc=; b=wUhKUVddRD7vc5EeqnqLIzyLd2W0/VDll3iIyZDMVC6qgGPTiLYzwgZhdkaE+gSBPYYmLT Jevgwtv2RQt0FJKksuS9UHlFRgp0Qf5d+BuGhKoFkVBfkwX2uZiOEt4VBmMhO0qyJcAgcG nAPQ2ZSnRoWQ9U+TNJMYmi2JE3ZNHKCkX4j0XCyf3aF5Oki+HyfwBMayxFIncvLdkNhIZk H2vyrztjhhrbIsZVPajMp7l6RDQ1ldFqcFeUmWrMAsXWhHOH1nFNnrrT48P45UJ0aL6Iq+ x7/aZSJByQhki5LLKeMI1oEpxMYMhm6GQwg240eIwpsXExQdrUh5nHIU7kmlTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X8ml35CprzKfL; Thu, 19 Sep 2024 20:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48JK7B4f017949; Thu, 19 Sep 2024 20:07:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48JK7BGJ017946; Thu, 19 Sep 2024 20:07:11 GMT (envelope-from git) Date: Thu, 19 Sep 2024 20:07:11 GMT Message-Id: <202409192007.48JK7BGJ017946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 95fbdf9df5b0 - stable/14 - ctladm: deprecate the undocumented "port -l" option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 95fbdf9df5b0918668517298d3ca77b65361b756 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=95fbdf9df5b0918668517298d3ca77b65361b756 commit 95fbdf9df5b0918668517298d3ca77b65361b756 Author: Alan Somers AuthorDate: 2024-06-06 21:09:38 +0000 Commit: Alan Somers CommitDate: 2024-09-19 20:03:39 +0000 ctladm: deprecate the undocumented "port -l" option It was mostly removed from the man page in 9c887a4f86f5fd4f51c23443dc8435e52783a782, 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 Reviewed by: mav Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D45522 (cherry picked from commit bb95fbf634b3459363a136899e9b241a2f6c49cd) --- usr.sbin/ctladm/ctladm.8 | 5 +---- usr.sbin/ctladm/ctladm.c | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index 6470f5d5a8ee..c8c013852246 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -590,9 +590,7 @@ The serial number is returned when the error is injected. .El .It Ic port Perform one of several CTL frontend port operations. -Either get a list of frontend ports -.Pq Fl l , -create a new frontend port +Either create a new frontend port .Pq Fl c , destroy a frontend port .Pq Fl r , @@ -607,7 +605,6 @@ for a given port. One of .Fl c , .Fl r , -.Fl l , .Fl o , or .Fl w diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 8538d8311332..67beef1e041e 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -180,7 +180,11 @@ static struct ctladm_opts option_table[] = { {"lunmap", CTLADM_CMD_LUNMAP, CTLADM_ARG_NONE, "p:l:L:"}, {"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"}, {"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:o:s:"}, +#if (__FreeBSD_version < 1600000) {"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"}, {"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"}, {"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"}, @@ -405,7 +409,9 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) char *driver = NULL; nvlist_t *option_list; ctl_port_type port_type = CTL_PORT_NONE; +#if (__FreeBSD_version < 1600000) int quiet = 0, xml = 0; +#endif option_list = nvlist_create(0); if (option_list == NULL) @@ -413,12 +419,22 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { +#if (__FreeBSD_version < 1600000) case 'l': + warnx("ctladm port -l is deprecated. " + "Use ctladm portlist instead"); if (port_mode != CCTL_PORT_MODE_NONE) goto bailout_badarg; port_mode = CCTL_PORT_MODE_LIST; break; + case 'q': + quiet = 1; + break; + case 'x': + xml = 1; + break; +#endif case 'c': port_mode = CCTL_PORT_MODE_CREATE; break; @@ -478,9 +494,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) case 'p': targ_port = strtol(optarg, NULL, 0); break; - case 'q': - quiet = 1; - break; case 't': { ctladm_optret optret; ctladm_cmdargs argnum; @@ -524,9 +537,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) wwpn = strtoull(optarg, NULL, 0); wwpn_set = 1; break; - case 'x': - xml = 1; - break; } } @@ -558,6 +568,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) entry.targ_port = targ_port; switch (port_mode) { +#if (__FreeBSD_version < 1600000) case CCTL_PORT_MODE_LIST: { char opts[] = "xq"; char argx[] = "-x"; @@ -574,6 +585,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) cctl_portlist(fd, argcx, argvx, opts); break; } +#endif case CCTL_PORT_MODE_REMOVE: case CCTL_PORT_MODE_CREATE: { bzero(&req, sizeof(req)); @@ -675,7 +687,7 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) fprintf(stdout, "Front End Ports disabled\n"); break; 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; goto bailout; break; @@ -3954,7 +3966,6 @@ usage(int error) "port options:\n" "-c : create new ioctl or iscsi frontend port\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 pp|vp : create new frontend port using pp and/or vp\n" "-w wwnn : set WWNN for one frontend\n" @@ -3962,8 +3973,6 @@ usage(int error) "-t port_type : specify fc, scsi, ioctl, internal frontend type\n" "-p targ_port : specify target port number\n" "-r : remove frontend port\n" -"-q : omit header in list output\n" -"-x : output port list in XML format\n" "portlist options:\n" "-f frontend : specify frontend type\n" "-i : report target and initiators addresses\n"