[master] 7a85739 Deprecate the second sub-argument to varnishd -l now that VSM autosizes everything.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 13 21:46:07 UTC 2017


commit 7a85739b1bd5f2000f853cb699e15c94d8308f3f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 13 21:45:21 2017 +0000

    Deprecate the second sub-argument to varnishd -l now that VSM
    autosizes everything.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 2b341f4..6da09e5 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -129,9 +129,8 @@ usage(void)
 	printf(FMT, "", "  -s malloc");
 	printf(FMT, "", "  -s file");
 
-	printf(FMT, "-l vsl[,vsm]", "Size of shared memory file");
+	printf(FMT, "-l vsl", "Size of shared memory log");
 	printf(FMT, "", "  vsl: space for VSL records [80m]");
-	printf(FMT, "", "  vsm: space for stats counters [1m]");
 
 	printf("\nSecurity options:\n");
 
@@ -269,7 +268,6 @@ init_params(struct cli *cli)
 		MCF_ParamConf(MCF_DEFAULT, "http_req_size", "12k");
 		MCF_ParamConf(MCF_DEFAULT, "gzip_buffer", "4k");
 		MCF_ParamConf(MCF_MAXIMUM, "vsl_space", "1G");
-		MCF_ParamConf(MCF_MAXIMUM, "vsm_space", "1G");
 	}
 
 #if !defined(HAVE_ACCEPT_FILTERS) || defined(__linux)
@@ -661,14 +659,17 @@ main(int argc, char * const *argv)
 			av = VAV_Parse(optarg, NULL, ARGV_COMMA);
 			AN(av);
 			if (av[0] != NULL)
-				ARGV_ERR("\t-l ...: %s\n", av[0]);
+				ARGV_ERR("-l ...: %s\n", av[0]);
+			if (av[1] != NULL && av[2] != NULL && av[3] != NULL)
+				ARGV_ERR("Too many sub arguments to -l\n");
 			if (av[1] != NULL) {
 				MCF_ParamSet(cli, "vsl_space", av[1]);
 				cli_check(cli);
 			}
 			if (av[1] != NULL && av[2] != NULL) {
-				MCF_ParamSet(cli, "vsm_space", av[2]);
-				cli_check(cli);
+				fprintf(stderr,
+				    "Warning: Ignoring deprecated second"
+				    " subargument to -l\n");
 			}
 			VAV_Free(av);
 			break;
diff --git a/bin/varnishtest/tests/a00016.vtc b/bin/varnishtest/tests/a00016.vtc
index 354b01f..4055b7a 100644
--- a/bin/varnishtest/tests/a00016.vtc
+++ b/bin/varnishtest/tests/a00016.vtc
@@ -1,4 +1,4 @@
-varnishtest "Test -I argument"
+varnishtest "Test -I and -l arguments"
 
 shell -err -expect {Only one -I allowed} {
 	touch foo bar
@@ -9,5 +9,17 @@ shell -err -expect {Error: -I file CLI command failed (104)} {
 	echo "vcl.list" > foo
 	echo "-foobar" >> foo
 	echo "vcl.load" >> foo
-	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m,1m
+	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m
+}
+
+shell -err -expect {Error: -l ...: Missing '"'} {
+	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l '2m,"'
+}
+
+shell -err -expect {Error: Too many sub arguments} {
+	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m,2m,2m
+}
+
+shell -err -expect {Warning: Ignoring deprecated second subargument} {
+	varnishd -f '' -I foo -n ${tmpdir}/v0 -a :0 -l 2m,2m
 }
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 33cfcb9..9f97f46 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -422,7 +422,7 @@ varnish_launch(struct varnish *v)
 		VSB_cat(vsb, " -p debug=+vsm_keep");
 		VSB_cat(vsb, " -p debug=+vmod_so_keep");
 	}
-	VSB_printf(vsb, " -l 2m,1m,-");
+	VSB_printf(vsb, " -l 2m");
 	VSB_printf(vsb, " -p auto_restart=off");
 	VSB_printf(vsb, " -p syslog_cli_traffic=off");
 	VSB_printf(vsb, " -p sigsegv_handler=on");
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index b8455c6..195a33b 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -180,12 +180,11 @@ Tuning options
   files. Name is referenced in logs, VCL, statistics, etc. If name
   is not specified, "s0", "s1" and so forth is used.
 
--l <vsl[,vsm]>
+-l <vsl>
 
-  Specifies size of shmlog file. vsl is the space for the VSL records
-  [80M] and vsm is the space for stats counters [1M]. Scaling suffixes
-  like 'K' and 'M' can be used up to (G)igabytes.
-  Default is 81 Megabytes.
+  Specifies size of the space for the VSL records.
+  Scaling suffixes like 'K' and 'M' can be used up to (G)igabytes.
+  Default is 80 Megabytes.
 
 Security options
 ----------------
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 837c62f..b1c1f33 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1605,11 +1605,10 @@ PARAM(
 	/* max */	"4G",
 	/* default */	"1M",
 	/* units */	"bytes",
-	/* flags */	MUST_RESTART,
+	/* flags */	0,
 	/* s-text */
-	"The amount of space to allocate for stats counters in the VSM "
-	"memory segment.  If you make this too small, some counters will "
-	"be invisible.  Making it too large just costs memory resources.",
+	"DEPRECATED: This parameter is ignored.\n"
+	"There is no global limit on amount of shared memory now.",
 	/* l-text */	"",
 	/* func */	NULL
 )


More information about the varnish-commit mailing list