REORG/MEDIUM: server: move the maintenance bits out of the server state
Now we introduce srv->admin and srv->prev_admin which are bitfields
containing one bit per source of administrative status (maintenance only
for now). For the sake of backwards compatibility we implement a single
source (ADMF_FMAINT) but the code already checks any source (ADMF_MAINT)
where the STF_MAINTAIN bit was previously checked. This will later allow
us to add ADMF_IMAINT for maintenance mode inherited from tracked servers.
Along doing these changes, it appeared that some places will need to be
revisited when implementing the inherited bit, this concerns all those
modifying the ADMF_FMAINT bit (enable/disable actions on the CLI or stats
page), and the checks to report "via" on the stats page. But currently
the code is harmless.
diff --git a/src/backend.c b/src/backend.c
index 3ce7415..0b4ff4d 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1489,7 +1489,7 @@
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_BOOL;
- if (!(srv->state & SRV_STF_MAINTAIN) &&
+ if (!(srv->admin & SRV_ADMF_MAINT) &&
(!(srv->check.state & CHK_ST_CONFIGURED) || (srv->state & SRV_STF_RUNNING)))
smp->data.uint = 1;
else