[master] 38f99fa Introduce a new category of boiler-plate notice for parameters: things you should not muck about with unless I tell you to.

Poul-Henning Kamp phk at varnish-cache.org
Thu Feb 17 21:37:47 CET 2011


commit 38f99fa695ed631d79f2e296f9936d8dcf0e12c5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 17 20:37:14 2011 +0000

    Introduce a new category of boiler-plate notice for parameters:
    things you should not muck about with unless I tell you to.

diff --git a/bin/varnishd/mgt_param.c b/bin/varnishd/mgt_param.c
index 306e69e..f15a5a2 100644
--- a/bin/varnishd/mgt_param.c
+++ b/bin/varnishd/mgt_param.c
@@ -483,6 +483,10 @@ tweak_diag_bitmap(struct cli *cli, const struct parspec *par, const char *arg)
 	"this parameter, or if the default value is even sensible.  " \
 	"Caution is advised, and feedback is most welcome."
 
+#define WIZARD_TEXT \
+	"\nNB: Do not change this parameter, unless a developer tell " \
+	"you to do so." 
+
 /*
  * Remember to update varnishd.1 whenever you add / remove a parameter or
  * change its default value.
@@ -862,7 +866,7 @@ static const struct parspec input_parspec[] = {
 		&master.critbit_cooloff, 60, 254,
 		"How long time the critbit hasher keeps deleted objheads "
 		"on the cooloff list.\n",
-		EXPERIMENTAL,
+		WIZARD,
 		"180.0", "s" },
 	{ "vcl_dir", tweak_string, &mgt_vcl_dir, 0, 0,
 		"Directory from which relative VCL filenames (vcl.load and "
@@ -958,6 +962,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
 				mcf_wrap(cli, MUST_RELOAD_TEXT);
 			if (pp->flags & MUST_RESTART)
 				mcf_wrap(cli, MUST_RESTART_TEXT);
+			if (pp->flags & WIZARD)
+				mcf_wrap(cli, WIZARD_TEXT);
 			if (!lfmt)
 				return;
 			else
diff --git a/bin/varnishd/vparam.h b/bin/varnishd/vparam.h
index b506267..47eae29 100644
--- a/bin/varnishd/vparam.h
+++ b/bin/varnishd/vparam.h
@@ -41,10 +41,11 @@ struct parspec {
 	double		max;
 	const char	*descr;
 	int		 flags;
-#define DELAYED_EFFECT 1
-#define EXPERIMENTAL   2
-#define MUST_RESTART   4
-#define MUST_RELOAD    8
+#define DELAYED_EFFECT	(1<<0)
+#define EXPERIMENTAL	(1<<1)
+#define MUST_RESTART	(1<<2)
+#define MUST_RELOAD	(1<<3)
+#define WIZARD		(1<<4)
 	const char	*def;
 	const char	*units;
 };



More information about the varnish-commit mailing list