[master] 9bca6f7b5 retire undocumented backend.list -v option

Nils Goroll nils.goroll at uplex.de
Sun Feb 17 11:43:07 UTC 2019


commit 9bca6f7b504221e7fdb2344daa9901fe980a68dc
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Feb 17 12:41:47 2019 +0100

    retire undocumented backend.list -v option
    
    as agreed on -commit.
    
    Closes #2906

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 36f036fdc..f5b867335 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -446,8 +446,8 @@ vbe_panic(const struct director *d, struct vsb *vsb)
  */
 
 static void v_matchproto_(vdi_list_f)
-vbe_list(VRT_CTX, const struct director *d, struct vsb *vsb, int vflag,
-    int pflag, int jflag)
+vbe_list(VRT_CTX, const struct director *d, struct vsb *vsb, int pflag,
+    int jflag)
 {
 	struct backend *bp;
 
@@ -457,12 +457,12 @@ vbe_list(VRT_CTX, const struct director *d, struct vsb *vsb, int vflag,
 	CAST_OBJ_NOTNULL(bp, d->priv, BACKEND_MAGIC);
 
 	if (bp->probe != NULL)
-		VBP_Status(vsb, bp, vflag | pflag, jflag);
-	else if (jflag && (vflag | pflag))
+		VBP_Status(vsb, bp, pflag, jflag);
+	else if (jflag && pflag)
 		VSB_printf(vsb, "{},\n");
 	else if (jflag)
 		VSB_printf(vsb, "\"%s\"", d->sick ? "sick" : "healthy");
-	else if (vflag | pflag)
+	else if (pflag)
 		return;
 	else
 		VSB_printf(vsb, "%-*s", VDI_LIST_W_PROBE,
diff --git a/bin/varnishd/cache/cache_director.c b/bin/varnishd/cache/cache_director.c
index 562059ae1..c8a4d863c 100644
--- a/bin/varnishd/cache/cache_director.c
+++ b/bin/varnishd/cache/cache_director.c
@@ -272,7 +272,6 @@ struct list_args {
 	unsigned	magic;
 #define LIST_ARGS_MAGIC	0x7e7cefeb
 	int		p;
-	int		v;
 	int		j;
 	const char	*jsep;
 };
@@ -306,14 +305,14 @@ do_list(struct cli *cli, struct director *d, void *priv)
 	     VDI_LIST_W_ADMIN, VDI_Ahealth(d));
 
 	if (d->vdir->methods->list != NULL)
-		d->vdir->methods->list(ctx, d, cli->sb, 0, 0, 0);
+		d->vdir->methods->list(ctx, d, cli->sb, 0, 0);
 	else
 		VCLI_Out(cli, "%-*s", VDI_LIST_W_PROBE, cli_health(ctx, d));
 
 	VTIM_format(d->vdir->health_changed, time_str);
 	VCLI_Out(cli, " %s", time_str);
-	if ((la->p || la->v) && d->vdir->methods->list != NULL)
-		d->vdir->methods->list(ctx, d, cli->sb, la->p, la->v, 0);
+	if (la->p && d->vdir->methods->list != NULL)
+		d->vdir->methods->list(ctx, d, cli->sb, la->p, 0);
 
 	VCL_Rel_CliCtx(&ctx);
 	AZ(ctx);
@@ -345,14 +344,14 @@ do_list_json(struct cli *cli, struct director *d, void *priv)
 	VCLI_Out(cli, "\"admin_health\": \"%s\",\n", VDI_Ahealth(d));
 	VCLI_Out(cli, "\"probe_message\": ");
 	if (d->vdir->methods->list != NULL)
-		d->vdir->methods->list(ctx, d, cli->sb, 0, 0, 1);
+		d->vdir->methods->list(ctx, d, cli->sb, 0, 1);
 	else
 		VCLI_Out(cli, "\"%s\"", cli_health(ctx, d));
 	VCLI_Out(cli, ",\n");
 
-	if ((la->p || la->v) && d->vdir->methods->list != NULL) {
+	if (la->p && d->vdir->methods->list != NULL) {
 		VCLI_Out(cli, "\"probe_details\": ");
-		d->vdir->methods->list(ctx, d, cli->sb, la->p, la->v, 1);
+		d->vdir->methods->list(ctx, d, cli->sb, la->p, 1);
 	}
 	VCLI_Out(cli, "\"last_change\": %.3f\n", d->vdir->health_changed);
 	VSB_indent(cli->sb, -2);
@@ -371,10 +370,6 @@ cli_backend_list(struct cli *cli, const char * const *av, void *priv)
 	struct list_args la[1];
 	int i;
 
-	/*
-	 * XXX for all cases in varnish-cache, -v is synonymous to
-	 * -p and -v is not documented. Retire?
-	 */
 	(void)priv;
 	ASSERT_CLI();
 	INIT_OBJ(la, LIST_ARGS_MAGIC);
@@ -384,7 +379,6 @@ cli_backend_list(struct cli *cli, const char * const *av, void *priv)
 			switch(*p) {
 			case 'j': la->j = 1; break;
 			case 'p': la->p = !la->p; break;
-			case 'v': la->p = !la->p; break;
 			default:
 				VCLI_Out(cli, "Invalid flag %c", *p);
 				VCLI_SetResult(cli, CLIS_PARAM);
diff --git a/doc/changes.rst b/doc/changes.rst
index d8fb2404c..ad3a2659a 100644
--- a/doc/changes.rst
+++ b/doc/changes.rst
@@ -68,6 +68,9 @@ Varnish Cache trunk (ongoing)
   For best forward compatibility, we recommend that scripts parse JSON
   output as obtained using the ``-j`` option.
 
+* The undocumented ``-v`` option to the ``backend.list`` cli command
+  has been removed
+
 VCL
 ---
 
diff --git a/include/vrt.h b/include/vrt.h
index 091508dda..11c4eb2c2 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -478,7 +478,7 @@ typedef enum sess_close vdi_http1pipe_f(VRT_CTX, VCL_BACKEND);
 typedef void vdi_event_f(VCL_BACKEND, enum vcl_event_e);
 typedef void vdi_destroy_f(VCL_BACKEND);
 typedef void vdi_panic_f(VCL_BACKEND, struct vsb *);
-typedef void vdi_list_f(VRT_CTX, VCL_BACKEND, struct vsb *, int, int, int);
+typedef void vdi_list_f(VRT_CTX, VCL_BACKEND, struct vsb *, int, int);
 
 struct vdi_methods {
 	unsigned			magic;


More information about the varnish-commit mailing list