ctdb-tests: Improve counting of database records
[samba.git] / ctdb / failover / failover_conf.c
1 /*
2    CTDB database config handling
3
4    Copyright (C) Martin Schwenke  2018
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "replace.h"
21
22 #include "lib/util/debug.h"
23
24 #include "common/conf.h"
25
26 #include "failover/failover_conf.h"
27
28 static bool check_static_boolean_change(const char *key,
29                                         bool old_value,
30                                         bool new_value,
31                                         enum conf_update_mode mode)
32 {
33         if (mode == CONF_MODE_RELOAD || CONF_MODE_API) {
34                 if (old_value != new_value) {
35                         D_WARNING("Ignoring update of [%s] -> %s\n",
36                                   FAILOVER_CONF_SECTION,
37                                   key);
38                 }
39         }
40
41         return true;
42 }
43
44 void failover_conf_init(struct conf_context *conf)
45 {
46         conf_define_section(conf, FAILOVER_CONF_SECTION, NULL);
47
48         conf_define_boolean(conf,
49                             FAILOVER_CONF_SECTION,
50                             FAILOVER_CONF_DISABLED,
51                             false,
52                             check_static_boolean_change);
53 }