[master] 9c8609d Pass ident via heritage.

Poul-Henning Kamp phk at FreeBSD.org
Tue Sep 26 21:53:08 UTC 2017


commit 9c8609de2569edf3088dd2cf6f4fe5c5fe587993
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 26 21:40:12 2017 +0000

    Pass ident via heritage.

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 6e5a660..4cadaea 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -630,7 +630,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 	VSB_printf(pan_vsb, "version = %s, vrt api = %u.%u\n",
 	    VCS_version, VRT_MAJOR_VERSION, VRT_MINOR_VERSION);
 	VSB_printf(pan_vsb, "ident = %s,%s\n",
-	    VSB_data(vident) + 1, Waiter_GetName());
+	    heritage.ident + 1, Waiter_GetName());
 	VSB_printf(pan_vsb, "now = %f (mono), %f (real)\n",
 	    VTIM_mono(), VTIM_real());
 
diff --git a/bin/varnishd/common/common.h b/bin/varnishd/common/common.h
index 78e6599..b969cc3 100644
--- a/bin/varnishd/common/common.h
+++ b/bin/varnishd/common/common.h
@@ -50,15 +50,9 @@
 #  define MAX_THREAD_POOLS 32
 #endif
 
-/* Name of transient storage */
-#define TRANSIENT_STORAGE	"Transient"
-
 extern pid_t mgt_pid;
 #define ASSERT_MGT() do { assert(getpid() == mgt_pid);} while (0)
 
-/* varnishd.c */
-extern struct vsb *vident;		// XXX: -> heritage ?
-
 /* Really belongs in mgt.h, but storage_file chokes on both */
 void MCH_Fd_Inherit(int fd, const char *what);
 
diff --git a/bin/varnishd/common/heritage.h b/bin/varnishd/common/heritage.h
index 238c293..461c387 100644
--- a/bin/varnishd/common/heritage.h
+++ b/bin/varnishd/common/heritage.h
@@ -84,6 +84,8 @@ struct heritage {
 	ssize_t				panic_str_len;
 
 	struct VCLS			*cls;
+
+	const char			*ident;
 };
 
 extern struct heritage heritage;
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index 7594bd4..4573fbd 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -135,6 +135,7 @@ extern const struct jail_tech jail_tech_unix;
 extern const struct jail_tech jail_tech_solaris;
 
 /* mgt_main.c */
+extern struct vsb *vident;
 extern struct VSC_mgt	*VSC_C_mgt;
 struct choice {
 	const char      *name;
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 6aec3f4..9d908fb 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -366,6 +366,7 @@ mgt_launch_child(struct cli *cli)
 		mgt_ProcTitle("Child");
 
 		heritage.cls = mgt_cls;
+		heritage.ident = VSB_data(vident) + 1;
 
 		if (mgt_param.sigsegv_handler) {
 			memset(&sa, 0, sizeof sa);
diff --git a/bin/varnishd/storage/mgt_stevedore.c b/bin/varnishd/storage/mgt_stevedore.c
index b1d0288..4146ff9 100644
--- a/bin/varnishd/storage/mgt_stevedore.c
+++ b/bin/varnishd/storage/mgt_stevedore.c
@@ -46,6 +46,9 @@
 static VTAILQ_HEAD(, stevedore) stevedores =
     VTAILQ_HEAD_INITIALIZER(stevedores);
 
+/* Name of transient storage */
+#define TRANSIENT_STORAGE	"Transient"
+
 struct stevedore *stv_transient;
 
 /*--------------------------------------------------------------------*/


More information about the varnish-commit mailing list