Commit 6e4d4b3b authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

param: Document timeout "never" with a pseudo-flag

The timeout type is the authority from which both the tweak and flag
are derived.
parent 36087a87
...@@ -62,6 +62,10 @@ static const int tab0 = 3; ...@@ -62,6 +62,10 @@ static const int tab0 = 3;
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static const char TYPE_TIMEOUT_TEXT[] =
"\n\n"
"NB: This parameter can be disabled with the value \"never\".";
static const char OBJ_STICKY_TEXT[] = static const char OBJ_STICKY_TEXT[] =
"\n\n" "\n\n"
"NB: This parameter is evaluated only when objects are created. " "NB: This parameter is evaluated only when objects are created. "
...@@ -337,6 +341,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv) ...@@ -337,6 +341,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
margin1, "", pp->max); margin1, "", pp->max);
VCLI_Out(cli, "\n"); VCLI_Out(cli, "\n");
mcf_wrap(cli, pp->descr); mcf_wrap(cli, pp->descr);
if (pp->func == tweak_timeout)
mcf_wrap(cli, TYPE_TIMEOUT_TEXT);
if (pp->flags & OBJ_STICKY) if (pp->flags & OBJ_STICKY)
mcf_wrap(cli, OBJ_STICKY_TEXT); mcf_wrap(cli, OBJ_STICKY_TEXT);
if (pp->flags & DELAYED_EFFECT) if (pp->flags & DELAYED_EFFECT)
...@@ -825,6 +831,7 @@ MCF_DumpRstParam(void) ...@@ -825,6 +831,7 @@ MCF_DumpRstParam(void)
struct plist *pl; struct plist *pl;
const struct parspec *pp; const struct parspec *pp;
const char *p, *q, *t1, *t2; const char *p, *q, *t1, *t2;
unsigned flags;
size_t z; size_t z;
printf("\n.. The following is the autogenerated " printf("\n.. The following is the autogenerated "
...@@ -857,35 +864,42 @@ MCF_DumpRstParam(void) ...@@ -857,35 +864,42 @@ MCF_DumpRstParam(void)
MCF_DYN_REASON(Minimum, min); MCF_DYN_REASON(Minimum, min);
MCF_DYN_REASON(Maximum, max); MCF_DYN_REASON(Maximum, max);
#undef MCF_DYN_REASON #undef MCF_DYN_REASON
if (pp->flags & ~DOCS_FLAGS) { flags = pp->flags & ~DOCS_FLAGS;
if (pp->func == tweak_timeout)
flags |= TYPE_TIMEOUT;
if (flags) {
printf("\t* Flags: "); printf("\t* Flags: ");
q = ""; q = "";
if (pp->flags & DELAYED_EFFECT) { if (flags & TYPE_TIMEOUT) {
printf("%stimeout", q);
q = ", ";
}
if (flags & DELAYED_EFFECT) {
printf("%sdelayed", q); printf("%sdelayed", q);
q = ", "; q = ", ";
} }
if (pp->flags & MUST_RESTART) { if (flags & MUST_RESTART) {
printf("%smust_restart", q); printf("%smust_restart", q);
q = ", "; q = ", ";
} }
if (pp->flags & MUST_RELOAD) { if (flags & MUST_RELOAD) {
printf("%smust_reload", q); printf("%smust_reload", q);
q = ", "; q = ", ";
} }
if (pp->flags & EXPERIMENTAL) { if (flags & EXPERIMENTAL) {
printf("%sexperimental", q); printf("%sexperimental", q);
q = ", "; q = ", ";
} }
if (pp->flags & WIZARD) { if (flags & WIZARD) {
printf("%swizard", q); printf("%swizard", q);
q = ", "; q = ", ";
} }
if (pp->flags & ONLY_ROOT) { if (flags & ONLY_ROOT) {
printf("%sonly_root", q); printf("%sonly_root", q);
q = ", "; q = ", ";
} }
if (pp->flags & OBJ_STICKY) { if (flags & OBJ_STICKY) {
printf("%sobj_sticky", q); printf("%sobj_sticky", q);
q = ", "; q = ", ";
} }
......
...@@ -58,6 +58,7 @@ struct parspec { ...@@ -58,6 +58,7 @@ struct parspec {
#define NOT_IMPLEMENTED (1<<8) #define NOT_IMPLEMENTED (1<<8)
#define PLATFORM_DEPENDENT (1<<9) #define PLATFORM_DEPENDENT (1<<9)
#define BUILD_OPTIONS (1<<10) #define BUILD_OPTIONS (1<<10)
#define TYPE_TIMEOUT (1<<11)
#define DOCS_FLAGS (NOT_IMPLEMENTED|PLATFORM_DEPENDENT|BUILD_OPTIONS) #define DOCS_FLAGS (NOT_IMPLEMENTED|PLATFORM_DEPENDENT|BUILD_OPTIONS)
......
...@@ -590,7 +590,7 @@ A duration parameter may accept the following units suffixes: ...@@ -590,7 +590,7 @@ A duration parameter may accept the following units suffixes:
- ``w`` (weeks) - ``w`` (weeks)
- ``y`` (years) - ``y`` (years)
If the parameter is a timeout or a deadline, a value of zero (when allowed) If the parameter is a timeout or a deadline, a value of "never" (when allowed)
disables the effect of the parameter. disables the effect of the parameter.
Run Time Parameter Flags Run Time Parameter Flags
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment