Date: Mon, 1 Jul 2024 17:08:53 -0400 From: John Baldwin <jhb@FreeBSD.org> To: Alan Somers <asomers@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: edbd489d09ba - main - ctladm: don't require the use of "-p" with "port -r" Message-ID: <ce4568e5-7929-472a-9778-c5e0ecf35270@FreeBSD.org> In-Reply-To: <202406101601.45AG1jSb001516@gitrepo.freebsd.org> References: <202406101601.45AG1jSb001516@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/10/24 9:01 AM, Alan Somers wrote: > The branch main has been updated by asomers: > > URL: https://cgit.FreeBSD.org/src/commit/?id=edbd489d09babebdc6c03924a912013be584c409 > > commit edbd489d09babebdc6c03924a912013be584c409 > Author: Alan Somers <asomers@FreeBSD.org> > AuthorDate: 2024-06-06 19:14:43 +0000 > Commit: Alan Somers <asomers@FreeBSD.org> > CommitDate: 2024-06-10 16:01:25 +0000 > > ctladm: don't require the use of "-p" with "port -r" > > When removing a port, the ioctl frontend requires the "-p" argument. > But other frontends, like cfiscsi, do not. So don't require that > argument in the ctladm command. The frontend driver will report an > error if any required argument is missing. > > MFC after: 2 weeks > Sponsored by: Axcient > Reviewed by: mav > Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 > --- > sys/cam/ctl/ctl_frontend_ioctl.c | 2 +- > usr.sbin/ctladm/ctladm.8 | 3 +-- > usr.sbin/ctladm/ctladm.c | 10 +++------- > usr.sbin/ctladm/tests/port.sh | 28 +++++++++++++++++++++++----- > 4 files changed, 28 insertions(+), 15 deletions(-) > > diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c > index 14951797ddf1..46b7b88547dd 100644 > --- a/usr.sbin/ctladm/ctladm.c > +++ b/usr.sbin/ctladm/ctladm.c > @@ -580,11 +580,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) > break; > } > case CCTL_PORT_MODE_REMOVE: > - if (targ_port == -1) { > - warnx("%s: -r requires -p", __func__); > - retval = 1; > - goto bailout; > - } > /* FALLTHROUGH */ Should we just remove the FALLTHOUGH now? > case CCTL_PORT_MODE_CREATE: { > bzero(&req, sizeof(req)); > diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh > index 1f2c9aaed5c1..139e1a7d29a0 100644 > --- a/usr.sbin/ctladm/tests/port.sh > +++ b/usr.sbin/ctladm/tests/port.sh > @@ -37,8 +37,6 @@ cleanup() { > ;; > "iscsi") > TARGET=`awk '/target:/ {print $2}' port-create.txt` > - # PORTNUM is ignored, but must be set > - PORTNUM=9999 > ctladm port -r -d $driver -p "$PORTNUM" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET You still use PORTNUM here even though you don't define it? > ;; > esac -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ce4568e5-7929-472a-9778-c5e0ecf35270>