Date: Fri, 11 Apr 2025 14:03:59 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 0708eb01f280 - main - ctld: Drop commented-out code to print the configuration Message-ID: <202504111403.53BE3xlb053682@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0708eb01f28040a50693f40833562ab14fbfe2ad commit 0708eb01f28040a50693f40833562ab14fbfe2ad Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-04-11 14:01:29 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-04-11 14:01:29 +0000 ctld: Drop commented-out code to print the configuration This code is incomplete (it does not handle some of the options that can be set) and easily rots since it is not enabled by default or hooked up to anything that calls it. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D49646 --- usr.sbin/ctld/ctld.cc | 62 --------------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc index 6360a88e5c97..08ac91a75c21 100644 --- a/usr.sbin/ctld/ctld.cc +++ b/usr.sbin/ctld/ctld.cc @@ -1347,68 +1347,6 @@ connection_new(struct portal *portal, int fd, const char *host, return (conn); } -#if 0 -static void -options_print(const char *prefix, nvlist_t *nvl) -{ - const char *name; - void *cookie; - - cookie = NULL; - while ((name = nvlist_next(nvl, NULL, &cookie)) != NULL) { - fprintf(stderr, "%soption %s %s\n", prefix, name, - nvlist_get_string(nvl, name)); - } -} - -static void -conf_print(struct conf *conf) -{ - struct auth_group *ag; - struct auth *auth; - struct auth_name *auth_name; - struct auth_portal *auth_portal; - struct portal_group *pg; - struct portal *portal; - struct target *targ; - struct lun *lun; - - TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) { - fprintf(stderr, "auth-group %s {\n", ag->ag_name); - TAILQ_FOREACH(auth, &ag->ag_auths, a_next) - fprintf(stderr, "\t chap-mutual %s %s %s %s\n", - auth->a_user, auth->a_secret, - auth->a_mutual_user, auth->a_mutual_secret); - TAILQ_FOREACH(auth_name, &ag->ag_names, an_next) - fprintf(stderr, "\t initiator-name %s\n", - auth_name->an_initiator_name); - TAILQ_FOREACH(auth_portal, &ag->ag_portals, ap_next) - fprintf(stderr, "\t initiator-portal %s\n", - auth_portal->ap_initiator_portal); - fprintf(stderr, "}\n"); - } - TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { - fprintf(stderr, "portal-group %s {\n", pg->pg_name); - TAILQ_FOREACH(portal, &pg->pg_portals, p_next) - fprintf(stderr, "\t listen %s\n", portal->p_listen); - options_print("\t", pg->pg_options); - fprintf(stderr, "}\n"); - } - TAILQ_FOREACH(lun, &conf->conf_luns, l_next) { - fprintf(stderr, "\tlun %s {\n", lun->l_name); - fprintf(stderr, "\t\tpath %s\n", lun->l_path); - options_print("\t\t", lun->l_options); - fprintf(stderr, "\t}\n"); - } - TAILQ_FOREACH(targ, &conf->conf_targets, t_next) { - fprintf(stderr, "target %s {\n", targ->t_name); - if (targ->t_alias != NULL) - fprintf(stderr, "\t alias %s\n", targ->t_alias); - fprintf(stderr, "}\n"); - } -} -#endif - static bool conf_verify_lun(struct lun *lun) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202504111403.53BE3xlb053682>