Mailing List Archive

[master] 1f36ded9f param: New BUILD_OPTIONS flag
commit 1f36ded9f7be01f57326f1dfb57e7ed69d37373b
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Thu Sep 9 07:47:50 2021 +0200

param: New BUILD_OPTIONS flag

Similar to PLATFORM_DEPENDENT for things affected by configure options
or other build flags that are not necessarily linked to the target
platform.

diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 3b160dcf9..2b4c293ca 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -110,6 +110,11 @@ static const char PLATFORM_DEPENDENT_TEXT[] =
"NB: This parameter depends on a feature which is not available"
" on all platforms.";

+static const char BUILD_OPTIONS_TEXT[] =
+ "\n\n"
+ "NB: The actual default value for this parameter depends on the"
+ " Varnish build environment and options.";
+
/*--------------------------------------------------------------------*/

static struct parspec *
@@ -343,6 +348,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
mcf_wrap(cli, PROTECTED_TEXT);
if (pp->flags & ONLY_ROOT)
mcf_wrap(cli, ONLY_ROOT_TEXT);
+ if (pp->flags & BUILD_OPTIONS)
+ mcf_wrap(cli, BUILD_OPTIONS_TEXT);
VCLI_Out(cli, "\n\n");
}
}
@@ -464,6 +471,7 @@ mcf_param_show_json(struct cli *cli, const char * const *av, void *priv)
flag_out(WIZARD, wizard);
flag_out(PROTECTED, protected);
flag_out(ONLY_ROOT, only_root);
+ flag_out(BUILD_OPTIONS, build_options);

#undef flag_out

@@ -806,6 +814,9 @@ MCF_DumpRstParam(void)
if (pp->flags && pp->flags & PLATFORM_DEPENDENT)
printf("\n%s\n\n", PLATFORM_DEPENDENT_TEXT);

+ if (pp->flags && pp->flags & BUILD_OPTIONS)
+ printf("\n%s\n\n", BUILD_OPTIONS_TEXT);
+
if (pp->units != NULL && *pp->units != '\0')
printf("\t* Units: %s\n", pp->units);
#define MCF_DYN_REASON(lbl, nm) \
@@ -823,7 +834,7 @@ MCF_DumpRstParam(void)
* XXX: that say if ->min/->max are valid, so we
* XXX: can emit those also in help texts.
*/
- if (pp->flags & ~(NOT_IMPLEMENTED|PLATFORM_DEPENDENT)) {
+ if (pp->flags & ~DOCS_FLAGS) {
printf("\t* Flags: ");
q = "";

diff --git a/bin/varnishd/mgt/mgt_param.h b/bin/varnishd/mgt/mgt_param.h
index f3af67df5..b15286f89 100644
--- a/bin/varnishd/mgt/mgt_param.h
+++ b/bin/varnishd/mgt/mgt_param.h
@@ -57,6 +57,9 @@ struct parspec {
#define ONLY_ROOT (1<<7)
#define NOT_IMPLEMENTED (1<<8)
#define PLATFORM_DEPENDENT (1<<9)
+#define BUILD_OPTIONS (1<<10)
+
+#define DOCS_FLAGS (NOT_IMPLEMENTED|PLATFORM_DEPENDENT|BUILD_OPTIONS)

const char *dyn_min_reason;
const char *dyn_max_reason;
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit