[master] d2acc546a Move VEXT code to mgt

Nils Goroll nils.goroll at uplex.de
Mon Dec 8 15:02:05 UTC 2025


commit d2acc546ab3651150519fad8af0e741f5431018b
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri Nov 28 16:22:40 2025 +0100

    Move VEXT code to mgt
    
    VEXTs get loaded early after the worker process fork, but that code is owned by
    mgt and, after that, the cache worker has no business in VEXTs.
    
    The variable rename is to avoid shadowing

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 0d60f1b18..bbda7dea9 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -63,7 +63,6 @@ varnishd_SOURCES = \
 	cache/cache_ws_common.c \
 	common/common_vsc.c \
 	common/common_vsmw.c \
-	common/common_vext.c \
 	hash/hash_classic.c \
 	hash/hash_critbit.c \
 	hash/hash_simple_list.c \
@@ -99,6 +98,7 @@ varnishd_SOURCES = \
 	mgt/mgt_util.c \
 	mgt/mgt_vcc.c \
 	mgt/mgt_vcl.c \
+	mgt/mgt_vext.c \
 	proxy/cache_proxy_proto.c \
 	proxy/cache_proxy.h \
 	storage/mgt_stevedore.c \
diff --git a/bin/varnishd/common/heritage.h b/bin/varnishd/common/heritage.h
index aedc7c295..9868ab5cb 100644
--- a/bin/varnishd/common/heritage.h
+++ b/bin/varnishd/common/heritage.h
@@ -134,12 +134,3 @@ extern vsm_lock_f *vsc_lock;
 extern vsm_lock_f *vsc_unlock;
 extern vsm_lock_f *vsmw_lock;
 extern vsm_lock_f *vsmw_unlock;
-
-/* common/common_vext.c */
-
-void vext_argument(const char *);
-void vext_copyin(struct vsb *);
-void vext_load(void);
-void vext_cleanup(int);
-typedef void vext_iter_f(const char *, void *);
-void vext_iter(vext_iter_f *func, void *);
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index 3f20777c7..826678000 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -263,3 +263,11 @@ pthread_create(void)
 #define MGT_EXPERIMENT(x)	COM_EXPERIMENT(mgt_param.experimental_bits, x)
 #define MGT_DO_DEBUG(x)		COM_DO_DEBUG(mgt_param.debug_bits, x)
 #define MGT_VCC_FEATURE(x)	COM_VCC_FEATURE(mgt_param.vcc_feature_bits, x)
+
+/* mgt_vext.c */
+void vext_argument(const char *);
+void vext_copyin(struct vsb *);
+void vext_load(void);
+void vext_cleanup(int);
+typedef void vext_iter_f(const char *, void *);
+void vext_iter(vext_iter_f *func, void *);
diff --git a/bin/varnishd/common/common_vext.c b/bin/varnishd/mgt/mgt_vext.c
similarity index 97%
rename from bin/varnishd/common/common_vext.c
rename to bin/varnishd/mgt/mgt_vext.c
index 169cb13ee..30c0b2661 100644
--- a/bin/varnishd/common/common_vext.c
+++ b/bin/varnishd/mgt/mgt_vext.c
@@ -40,7 +40,8 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "vdef.h"
+#include "mgt.h"
+
 #include "vas.h"
 #include "miniobj.h"
 #include "vav.h"
@@ -48,7 +49,7 @@
 #include "vrnd.h"
 #include "vsb.h"
 
-#include "heritage.h"
+#include "common/heritage.h"
 
 struct vext {
 	unsigned		magic;
@@ -95,7 +96,7 @@ vext_iter(vext_iter_f *func, void *priv)
 }
 
 void
-vext_copyin(struct vsb *vident)
+vext_copyin(struct vsb *vi)
 {
 	struct vext *vp;
 	const char *p;
@@ -115,7 +116,7 @@ vext_copyin(struct vsb *vident)
 			p++;
 		else
 			p = vp->argv[0];
-		VSB_printf(vident, ",-E%s", p);
+		VSB_printf(vi, ",-E%s", p);
 		VSB_printf(vp->vsb, "vext_cache/%s,", p);
 		for (i = 0; i < 8; i++) {
 			AZ(VRND_RandomCrypto(&u, sizeof u));



More information about the varnish-commit mailing list