[master] 457708d Change default storage to "-smalloc,100m"

Poul-Henning Kamp phk at varnish-cache.org
Fri Nov 8 12:01:16 CET 2013


commit 457708df7d926be7d65e5e58260d00a2d70063e3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Nov 8 11:00:02 2013 +0000

    Change default storage to "-smalloc,100m"
    
    Reflect this change in varnishtest, and retire the "-storage"
    keyword, storage settings can now be done with -arg.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index d21324f..739d441 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -166,8 +166,8 @@ usage(void)
 	fprintf(stderr, FMT, "-p param=value", "set parameter");
 	fprintf(stderr, FMT, "-r param[,param...]", "make parameter read-only");
 	fprintf(stderr, FMT,
-	    "-s kind[,storageoptions]", "Backend storage specification");
-	fprintf(stderr, FMT, "", "  -s malloc");
+	    "-s [name=]kind[,options]", "Backend storage specification");
+	fprintf(stderr, FMT, "", "  -s malloc[,<size>]");
 #ifdef HAVE_LIBUMEM
 	fprintf(stderr, FMT, "", "  -s umem");
 #endif
@@ -351,7 +351,7 @@ main(int argc, char * const *argv)
 	const char *n_arg = NULL;
 	const char *P_arg = NULL;
 	const char *S_arg = NULL;
-	const char *s_arg = "file";
+	const char *s_arg = "malloc,100m";
 	int s_arg_given = 0;
 	const char *T_arg = NULL;
 	char *p, *vcl = NULL;
diff --git a/bin/varnishtest/tests/b00000.vtc b/bin/varnishtest/tests/b00000.vtc
index f514f2b..2e34a13 100644
--- a/bin/varnishtest/tests/b00000.vtc
+++ b/bin/varnishtest/tests/b00000.vtc
@@ -5,7 +5,7 @@ server s1 {
 	txresp -body "012345\n"
 } -start
 
-varnish v1 -storage "-smalloc,1m" -vcl+backend {} -start
+varnish v1 -vcl+backend {} -start
 
 varnish v1 -cliok "param.set debug +workspace"
 
diff --git a/bin/varnishtest/tests/c00044.vtc b/bin/varnishtest/tests/c00044.vtc
index 8d4078b..f7b4f38 100644
--- a/bin/varnishtest/tests/c00044.vtc
+++ b/bin/varnishtest/tests/c00044.vtc
@@ -17,7 +17,11 @@ server s1 {
 	txresp -bodylen 1047194
 } -start
 
-varnish v1 -storage "-smalloc,1m -smalloc,1m, -smalloc,1m" -vcl+backend {
+varnish v1 \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+ 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 		set beresp.storage = "invalid";
diff --git a/bin/varnishtest/tests/c00045.vtc b/bin/varnishtest/tests/c00045.vtc
index 9168158..23967fa 100644
--- a/bin/varnishtest/tests/c00045.vtc
+++ b/bin/varnishtest/tests/c00045.vtc
@@ -9,7 +9,11 @@ server s1 {
 	txresp -bodylen 1047190
 } -start
 
-varnish v1 -storage "-smalloc,1m -smalloc,1m, -smalloc,1m" -vcl+backend {
+varnish v1 \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 		set beresp.storage = "s0";
diff --git a/bin/varnishtest/tests/c00046.vtc b/bin/varnishtest/tests/c00046.vtc
index 8982a92..a2e1d2b 100644
--- a/bin/varnishtest/tests/c00046.vtc
+++ b/bin/varnishtest/tests/c00046.vtc
@@ -9,7 +9,11 @@ server s1 {
 	txresp -bodylen 1000002
 } -start
 
-varnish v1 -storage "-smalloc,1m -smalloc,1m, -smalloc,1m" -vcl+backend {
+varnish v1 \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+	-arg "-smalloc,1m" \
+	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.storage = "s0";
 	}
diff --git a/bin/varnishtest/tests/e00007.vtc b/bin/varnishtest/tests/e00007.vtc
index 0f5d86a..519759c 100644
--- a/bin/varnishtest/tests/e00007.vtc
+++ b/bin/varnishtest/tests/e00007.vtc
@@ -31,7 +31,7 @@ server s1 {
 	}
 } -start
 
-varnish v1 -storage "-smalloc,2m" -vcl+backend {
+varnish v1 -arg "-smalloc,2m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/g00002.vtc b/bin/varnishtest/tests/g00002.vtc
index 5605b25..6c1597c 100644
--- a/bin/varnishtest/tests/g00002.vtc
+++ b/bin/varnishtest/tests/g00002.vtc
@@ -12,7 +12,7 @@ server s1 {
 } -start
 
 varnish v1 \
-	-storage "-smalloc,2m" \
+	-arg "-smalloc,2m" \
 	-cliok "param.set http_gzip_support true" \
 	-cliok "param.set gzip_memlevel 1" \
 	-vcl+backend {
diff --git a/bin/varnishtest/tests/p00000.vtc b/bin/varnishtest/tests/p00000.vtc
index 461da5f..ab59ccf 100644
--- a/bin/varnishtest/tests/p00000.vtc
+++ b/bin/varnishtest/tests/p00000.vtc
@@ -9,7 +9,7 @@ shell "rm -f ${tmpdir}/_.per"
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-vcl+backend { } -start
 
 varnish v1 -stop
diff --git a/bin/varnishtest/tests/p00001.vtc b/bin/varnishtest/tests/p00001.vtc
index 626b47d..8c38715 100644
--- a/bin/varnishtest/tests/p00001.vtc
+++ b/bin/varnishtest/tests/p00001.vtc
@@ -10,7 +10,7 @@ server s1 {
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-vcl+backend { } -start
 
 varnish v1 -cliok "param.set default_grace 0"
diff --git a/bin/varnishtest/tests/p00002.vtc b/bin/varnishtest/tests/p00002.vtc
index 4475918..1e04ebc 100644
--- a/bin/varnishtest/tests/p00002.vtc
+++ b/bin/varnishtest/tests/p00002.vtc
@@ -10,7 +10,8 @@ server s1 {
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-spersistent,${tmpdir}/_.per1,10m -spersistent,${tmpdir}/_.per2,10m" \
+	-arg "-spersistent,${tmpdir}/_.per1,10m" \
+	-arg "-spersistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend { } -start
 
 client c1 {
diff --git a/bin/varnishtest/tests/p00003.vtc b/bin/varnishtest/tests/p00003.vtc
index 573c8fe..0e8eec7 100644
--- a/bin/varnishtest/tests/p00003.vtc
+++ b/bin/varnishtest/tests/p00003.vtc
@@ -9,7 +9,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-arg "-pban_lurker_sleep=0" \
 	-vcl+backend { } -start
 
diff --git a/bin/varnishtest/tests/p00004.vtc b/bin/varnishtest/tests/p00004.vtc
index 21ceaef..c3aea98 100644
--- a/bin/varnishtest/tests/p00004.vtc
+++ b/bin/varnishtest/tests/p00004.vtc
@@ -11,7 +11,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-arg "-pban_lurker_sleep=0" \
 	-vcl+backend { } -start
 
diff --git a/bin/varnishtest/tests/p00005.vtc b/bin/varnishtest/tests/p00005.vtc
index f9a3682..dc95677 100644
--- a/bin/varnishtest/tests/p00005.vtc
+++ b/bin/varnishtest/tests/p00005.vtc
@@ -8,7 +8,7 @@ server s1 {
 } -start
 
 varnish v1 \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-arg "-pban_lurker_sleep=0" \
 	-vcl+backend {
 		sub vcl_backend_response {
diff --git a/bin/varnishtest/tests/p00006.vtc b/bin/varnishtest/tests/p00006.vtc
index 09b88e0..96f4d17 100644
--- a/bin/varnishtest/tests/p00006.vtc
+++ b/bin/varnishtest/tests/p00006.vtc
@@ -11,7 +11,7 @@ server s1 {
 
 
 varnish v1 \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-arg "-pban_lurker_sleep=0" \
 	-vcl+backend { } -start
 
diff --git a/bin/varnishtest/tests/p00007.vtc b/bin/varnishtest/tests/p00007.vtc
index 7dc2e68..ca6d04d 100644
--- a/bin/varnishtest/tests/p00007.vtc
+++ b/bin/varnishtest/tests/p00007.vtc
@@ -24,7 +24,7 @@ server s1 {
 	txresp -bodylen 48
 } -start
 
-varnish v1 -storage "-spersistent,${tmpdir}/_.per,10m" \
+varnish v1 -arg "-spersistent,${tmpdir}/_.per,10m" \
 	-vcl+backend {} -start
 
 varnish v1 -cliok "debug.fragfetch 32"
diff --git a/bin/varnishtest/tests/p00008.vtc b/bin/varnishtest/tests/p00008.vtc
index 4ac6f8b..411c4b4 100644
--- a/bin/varnishtest/tests/p00008.vtc
+++ b/bin/varnishtest/tests/p00008.vtc
@@ -16,7 +16,8 @@ server s1 {
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-sper1=persistent,${tmpdir}/_.per1,10m -sper2=persistent,${tmpdir}/_.per2,10m" \
+	-arg "-sper1=persistent,${tmpdir}/_.per1,10m" \
+	-arg "-sper2=persistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend {
 		sub vcl_backend_response {
 			set beresp.storage = "per1";
@@ -44,7 +45,7 @@ server s1 -wait
 varnish v2 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-spersistent,${tmpdir}/_.per1,10m" \
+	-arg "-spersistent,${tmpdir}/_.per1,10m" \
 	-vcl+backend { } -start
 varnish v2 -cliok "ban obj.http.x-foo == foo"
 varnish v2 -cliok "ban.list"
@@ -55,7 +56,8 @@ varnish v2 -stop
 varnish v3 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-spersistent,${tmpdir}/_.per1,10m -spersistent,${tmpdir}/_.per2,10m" \
+	-arg "-spersistent,${tmpdir}/_.per1,10m" \
+	-arg "-spersistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend { } -start
 varnish v3 -cliok "ban.list"
 varnish v3 -stop
@@ -70,7 +72,7 @@ server s1 {
 varnish v4 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-spersistent,${tmpdir}/_.per2,10m" \
+	-arg "-spersistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend { } -start
 client c1 -connect ${v4_sock} {
 	txreq -url "/silo2"
diff --git a/bin/varnishtest/tests/p00009.vtc b/bin/varnishtest/tests/p00009.vtc
index a3dcf7b..47f216d 100644
--- a/bin/varnishtest/tests/p00009.vtc
+++ b/bin/varnishtest/tests/p00009.vtc
@@ -14,7 +14,8 @@ server s1 {
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0" \
-	-storage "-sper1=persistent,${tmpdir}/_.per1,10m -sper2=persistent,${tmpdir}/_.per2,10m" \
+	-arg "-sper1=persistent,${tmpdir}/_.per1,10m" \
+	-arg "-sper2=persistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend {
 	}
 varnish v1 -start
diff --git a/bin/varnishtest/tests/r00915.vtc b/bin/varnishtest/tests/r00915.vtc
index e66cdc6..607d6db 100644
--- a/bin/varnishtest/tests/r00915.vtc
+++ b/bin/varnishtest/tests/r00915.vtc
@@ -9,7 +9,7 @@ shell "rm -f ${tmpdir}/_.per"
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-vcl+backend {
 
 	sub vcl_backend_response {
diff --git a/bin/varnishtest/tests/r00962.vtc b/bin/varnishtest/tests/r00962.vtc
index 22ebbc1..9cae4cf 100644
--- a/bin/varnishtest/tests/r00962.vtc
+++ b/bin/varnishtest/tests/r00962.vtc
@@ -12,7 +12,8 @@ shell "rm -f ${tmpdir}/_.per?"
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per1,10m -spersistent,${tmpdir}/_.per2,10m" \
+	-arg "-spersistent,${tmpdir}/_.per1,10m" \
+	-arg "-spersistent,${tmpdir}/_.per2,10m" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.storage = "s0";
@@ -43,7 +44,8 @@ server s1 {
 
 varnish v2 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per2,10m -spersistent,${tmpdir}/_.per1,10m" \
+	-arg "-spersistent,${tmpdir}/_.per2,10m" \
+	-arg "-spersistent,${tmpdir}/_.per1,10m" \
 	-vcl+backend { } -start
 
 client c1 -connect ${v2_sock} {
diff --git a/bin/varnishtest/tests/r01140.vtc b/bin/varnishtest/tests/r01140.vtc
index 688181b..e38e304 100644
--- a/bin/varnishtest/tests/r01140.vtc
+++ b/bin/varnishtest/tests/r01140.vtc
@@ -19,7 +19,7 @@ server s1 {
 } -start
 
 varnish v1 -arg "-p nuke_limit=0 -p shortlived=0" \
-	-storage "-smalloc,1m" -vcl+backend {
+	-arg "-smalloc,1m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 	}
diff --git a/bin/varnishtest/tests/r01175.vtc b/bin/varnishtest/tests/r01175.vtc
index e7c05bf..5539b20 100644
--- a/bin/varnishtest/tests/r01175.vtc
+++ b/bin/varnishtest/tests/r01175.vtc
@@ -5,7 +5,7 @@ server s1 {
 	txresp -nolen -hdr "Content-Length: 1048576"
 } -start
 
-varnish v1 -storage "-s test=malloc,1M" -vcl+backend {
+varnish v1 -arg "-s test=malloc,1M" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.storage = "test";
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/r01176.vtc b/bin/varnishtest/tests/r01176.vtc
index d9a0a99..0af3a5f 100644
--- a/bin/varnishtest/tests/r01176.vtc
+++ b/bin/varnishtest/tests/r01176.vtc
@@ -5,7 +5,7 @@ server s1 {
 	txresp
 } -start
 
-varnish v1 -storage "-s Transient=malloc" -vcl+backend {} -start
+varnish v1 -arg "-s Transient=malloc" -vcl+backend {} -start
 
 client c1 {
 	txreq
diff --git a/bin/varnishtest/tests/r01225.vtc b/bin/varnishtest/tests/r01225.vtc
index 3338d75..23d0253 100644
--- a/bin/varnishtest/tests/r01225.vtc
+++ b/bin/varnishtest/tests/r01225.vtc
@@ -10,7 +10,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
-	-storage "-spersistent,${tmpdir}/_.per,10m" \
+	-arg "-spersistent,${tmpdir}/_.per,10m" \
 	-arg "-pban_lurker_sleep=0.01" \
 	-vcl+backend { } -start
 
diff --git a/bin/varnishtest/tests/r01266.vtc b/bin/varnishtest/tests/r01266.vtc
index 49f2c67..04e3cb9 100644
--- a/bin/varnishtest/tests/r01266.vtc
+++ b/bin/varnishtest/tests/r01266.vtc
@@ -12,7 +12,7 @@ server s1 {
 varnish v1 \
 	-arg "-pfeature=+wait_silo" \
 	-arg "-pban_lurker_sleep=0.01" \
-	-storage "-sper1=persistent,${tmpdir}/_.per1,10m" \
+	-arg "-sper1=persistent,${tmpdir}/_.per1,10m" \
 	-vcl+backend {
 	}
 varnish v1 -start
diff --git a/bin/varnishtest/tests/r01283.vtc b/bin/varnishtest/tests/r01283.vtc
index e193e58..015b2fa 100644
--- a/bin/varnishtest/tests/r01283.vtc
+++ b/bin/varnishtest/tests/r01283.vtc
@@ -7,7 +7,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-p nuke_limit=0" \
-	-storage "-sTransient=malloc,1m" \
+	-arg "-sTransient=malloc,1m" \
 	-vcl+backend {
 	sub vcl_recv {
 		if (req.http.x-do-error) {
diff --git a/bin/varnishtest/tests/r01284.vtc b/bin/varnishtest/tests/r01284.vtc
index 5407685..68dc456 100644
--- a/bin/varnishtest/tests/r01284.vtc
+++ b/bin/varnishtest/tests/r01284.vtc
@@ -11,7 +11,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-p nuke_limit=0" \
-	-storage "-sTransient=malloc,1m" \
+	-arg "-sTransient=malloc,1m" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/v00010.vtc b/bin/varnishtest/tests/v00010.vtc
index c5f8fa5..58afdac 100644
--- a/bin/varnishtest/tests/v00010.vtc
+++ b/bin/varnishtest/tests/v00010.vtc
@@ -21,7 +21,7 @@ server s1 {
 	txresp -hdr "Foo: foo" -body "abcdef\n"
 } -start
 
-varnish v1 -storage "-smalloc,1m" -vcl+backend {
+varnish v1 -arg "-smalloc,1m" -vcl+backend {
 
 	import debug from "${topbuild}/lib/libvmod_debug/.libs/libvmod_debug.so";
 
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index e5a520c..a958fb0 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -57,8 +57,6 @@ struct varnish {
 	struct vtclog		*vl;
 	VTAILQ_ENTRY(varnish)	list;
 
-	struct vsb		*storage;
-
 	struct vsb		*args;
 	int			fds[4];
 	pid_t			pid;
@@ -285,10 +283,6 @@ varnish_new(const char *name)
 
 	v->args = VSB_new_auto();
 
-	v->storage = VSB_new_auto();
-	VSB_printf(v->storage, "-sfile,%s,10M", v->workdir);
-	AZ(VSB_finish(v->storage));
-
 	v->cli_fd = -1;
 	VTAILQ_INSERT_TAIL(&varnishes, v, list);
 
@@ -391,7 +385,6 @@ varnish_launch(struct varnish *v)
 	VSB_printf(vsb, " -a '%s'", "127.0.0.1:0");
 	VSB_printf(vsb, " -M '%s %s'", abuf, pbuf);
 	VSB_printf(vsb, " -P %s/varnishd.pid", v->workdir);
-	VSB_printf(vsb, " %s", VSB_data(v->storage));
 	VSB_printf(vsb, " %s", VSB_data(v->args));
 	AZ(VSB_finish(vsb));
 	vtc_log(v->vl, 3, "CMD: %s", VSB_data(vsb));
@@ -854,13 +847,6 @@ cmd_varnish(CMD_ARGS)
 	for (; *av != NULL; av++) {
 		if (vtc_error)
 			break;
-		if (!strcmp(*av, "-storage")) {
-			VSB_clear(v->storage);
-			VSB_cat(v->storage, av[1]);
-			AZ(VSB_finish(v->storage));
-			av++;
-			continue;
-		}
 		if (!strcmp(*av, "-arg")) {
 			AN(av[1]);
 			AZ(v->pid);



More information about the varnish-commit mailing list