git: 8f799d4b1c71 - stable/14 - ctld: Drop commented-out code to print the configuration

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 27 Jan 2026 18:44:30 UTC
The branch stable/14 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f799d4b1c7185d4b63310e86312c1867a8d7cb2

commit 8f799d4b1c7185d4b63310e86312c1867a8d7cb2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-04-11 14:01:29 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-01-27 18:15:58 +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
    
    (cherry picked from commit 0708eb01f28040a50693f40833562ab14fbfe2ad)
---
 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 8172e36e97f9..8a7a3c8b5a81 100644
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -1348,68 +1348,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)
 {