The branch, master has been updated via 11c4b253317 ctdb-conf: Rename config loading to not be daemon-specific via cf25243421c ctdb-conf: Move conf.[ch] to conf/ subdirectory via 52e5e926934 ctdb-conf: Move all conf files to new conf/ subdirectory from a77cffaa256 s4:torture: Initialize struct wrepl_wins_name
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 11c4b253317fb533b126e26a69e6a40b3c8b6c25 Author: Martin Schwenke <mschwe...@ddn.com> Date: Sat Jun 22 11:27:22 2024 +1000 ctdb-conf: Rename config loading to not be daemon-specific We might end up using it elsewhere. Signed-off-by: Martin Schwenke <mschwe...@ddn.com> Reviewed-by: Guenther Deschner <g...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> commit cf25243421c9941cb8caabe22a99ceee7422d1f0 Author: Martin Schwenke <mar...@meltin.net> Date: Mon Aug 19 12:17:20 2019 +1000 ctdb-conf: Move conf.[ch] to conf/ subdirectory Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Guenther Deschner <g...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> commit 52e5e9269345a16edf27df14392034738886c940 Author: Martin Schwenke <mar...@meltin.net> Date: Mon Aug 19 12:06:40 2019 +1000 ctdb-conf: Move all conf files to new conf/ subdirectory Leave common/conf.[ch] where they are to make this commit comprehensible. Signed-off-by: Martin Schwenke <mar...@meltin.net> Reviewed-by: Guenther Deschner <g...@samba.org> Reviewed-by: Anoop C S <anoo...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/{cluster => conf}/cluster_conf.c | 4 +-- ctdb/{cluster => conf}/cluster_conf.h | 2 +- ctdb/{common => conf}/conf.c | 2 +- ctdb/{common => conf}/conf.h | 0 ctdb/{common => conf}/conf_tool.c | 16 +++++----- ctdb/{common => conf}/conf_tool.h | 0 ctdb/{server => conf}/ctdb_config.c | 20 ++++++------ ctdb/{server => conf}/ctdb_config.h | 4 +-- ctdb/{database => conf}/database_conf.c | 4 +-- ctdb/{database => conf}/database_conf.h | 2 +- ctdb/{event => conf}/event_conf.c | 4 +-- ctdb/{event => conf}/event_conf.h | 2 +- ctdb/{failover => conf}/failover_conf.c | 4 +-- ctdb/{failover => conf}/failover_conf.h | 2 +- ctdb/{server => conf}/legacy_conf.c | 4 +-- ctdb/{server => conf}/legacy_conf.h | 2 +- ctdb/{common => conf}/logging_conf.c | 5 +-- ctdb/{common => conf}/logging_conf.h | 2 +- ctdb/event/event_config.c | 7 +++-- ctdb/server/ctdb_ltdb_server.c | 2 +- ctdb/server/ctdb_recoverd.c | 2 +- ctdb/server/ctdb_takeover.c | 2 +- ctdb/server/ctdbd.c | 8 ++--- ctdb/tests/src/conf_test.c | 2 +- ctdb/wscript | 54 +++++++++------------------------ 25 files changed, 67 insertions(+), 89 deletions(-) rename ctdb/{cluster => conf}/cluster_conf.c (98%) rename ctdb/{cluster => conf}/cluster_conf.h (98%) rename ctdb/{common => conf}/conf.c (99%) rename ctdb/{common => conf}/conf.h (100%) rename ctdb/{common => conf}/conf_tool.c (96%) rename ctdb/{common => conf}/conf_tool.h (100%) rename ctdb/{server => conf}/ctdb_config.c (93%) rename ctdb/{server => conf}/ctdb_config.h (93%) rename ctdb/{database => conf}/database_conf.c (98%) rename ctdb/{database => conf}/database_conf.h (98%) rename ctdb/{event => conf}/event_conf.c (97%) rename ctdb/{event => conf}/event_conf.h (97%) rename ctdb/{failover => conf}/failover_conf.c (95%) rename ctdb/{failover => conf}/failover_conf.h (97%) rename ctdb/{server => conf}/legacy_conf.c (97%) rename ctdb/{server => conf}/legacy_conf.h (97%) rename ctdb/{common => conf}/logging_conf.c (98%) rename ctdb/{common => conf}/logging_conf.h (97%) Changeset truncated at 500 lines: diff --git a/ctdb/cluster/cluster_conf.c b/ctdb/conf/cluster_conf.c similarity index 98% rename from ctdb/cluster/cluster_conf.c rename to ctdb/conf/cluster_conf.c index bdd64ba112f..b49a2440026 100644 --- a/ctdb/cluster/cluster_conf.c +++ b/ctdb/conf/cluster_conf.c @@ -22,9 +22,9 @@ #include "lib/util/debug.h" -#include "common/conf.h" +#include "conf/conf.h" -#include "cluster_conf.h" +#include "conf/cluster_conf.h" #define CLUSTER_TRANSPORT_DEFAULT "tcp" diff --git a/ctdb/cluster/cluster_conf.h b/ctdb/conf/cluster_conf.h similarity index 98% rename from ctdb/cluster/cluster_conf.h rename to ctdb/conf/cluster_conf.h index 38c378fd571..9775b6fc080 100644 --- a/ctdb/cluster/cluster_conf.h +++ b/ctdb/conf/cluster_conf.h @@ -20,7 +20,7 @@ #ifndef __CTDB_CLUSTER_CONF_H__ #define __CTDB_CLUSTER_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define CLUSTER_CONF_SECTION "cluster" diff --git a/ctdb/common/conf.c b/ctdb/conf/conf.c similarity index 99% rename from ctdb/common/conf.c rename to ctdb/conf/conf.c index a8ff724e73f..67046c715e2 100644 --- a/ctdb/common/conf.c +++ b/ctdb/conf/conf.c @@ -26,7 +26,7 @@ #include "lib/util/tini.h" #include "lib/util/debug.h" -#include "common/conf.h" +#include "conf/conf.h" struct conf_value { enum conf_type type; diff --git a/ctdb/common/conf.h b/ctdb/conf/conf.h similarity index 100% rename from ctdb/common/conf.h rename to ctdb/conf/conf.h diff --git a/ctdb/common/conf_tool.c b/ctdb/conf/conf_tool.c similarity index 96% rename from ctdb/common/conf_tool.c rename to ctdb/conf/conf_tool.c index 2d0543d643e..28f6c1090d0 100644 --- a/ctdb/common/conf_tool.c +++ b/ctdb/conf/conf_tool.c @@ -25,17 +25,17 @@ #include "common/logging.h" #include "common/cmdline.h" -#include "common/conf.h" #include "common/path.h" -#include "common/logging_conf.h" -#include "cluster/cluster_conf.h" -#include "database/database_conf.h" -#include "event/event_conf.h" -#include "failover/failover_conf.h" -#include "server/legacy_conf.h" +#include "conf/conf.h" +#include "conf/logging_conf.h" +#include "conf/cluster_conf.h" +#include "conf/database_conf.h" +#include "conf/event_conf.h" +#include "conf/failover_conf.h" +#include "conf/legacy_conf.h" -#include "common/conf_tool.h" +#include "conf/conf_tool.h" struct conf_tool_context { struct cmdline_context *cmdline; diff --git a/ctdb/common/conf_tool.h b/ctdb/conf/conf_tool.h similarity index 100% rename from ctdb/common/conf_tool.h rename to ctdb/conf/conf_tool.h diff --git a/ctdb/server/ctdb_config.c b/ctdb/conf/ctdb_config.c similarity index 93% rename from ctdb/server/ctdb_config.c rename to ctdb/conf/ctdb_config.c index 3f61fdae169..e3e8cce8d6b 100644 --- a/ctdb/server/ctdb_config.c +++ b/ctdb/conf/ctdb_config.c @@ -21,17 +21,17 @@ #include "lib/util/debug.h" -#include "common/conf.h" -#include "common/logging_conf.h" #include "common/path.h" -#include "cluster/cluster_conf.h" -#include "database/database_conf.h" -#include "event/event_conf.h" -#include "failover/failover_conf.h" -#include "legacy_conf.h" +#include "conf/conf.h" +#include "conf/logging_conf.h" +#include "conf/cluster_conf.h" +#include "conf/database_conf.h" +#include "conf/event_conf.h" +#include "conf/failover_conf.h" +#include "conf/legacy_conf.h" -#include "ctdb_config.h" +#include "conf/ctdb_config.h" struct ctdb_config ctdb_config; @@ -133,8 +133,8 @@ static void setup_config_pointers(struct conf_context *conf) &ctdb_config.script_log_level); } -int ctdbd_config_load(TALLOC_CTX *mem_ctx, - struct conf_context **result) +int ctdb_config_load(TALLOC_CTX *mem_ctx, + struct conf_context **result) { struct conf_context *conf = NULL; int ret = 0; diff --git a/ctdb/server/ctdb_config.h b/ctdb/conf/ctdb_config.h similarity index 93% rename from ctdb/server/ctdb_config.h rename to ctdb/conf/ctdb_config.h index 7ccda7d5d53..7b588c3cd59 100644 --- a/ctdb/server/ctdb_config.h +++ b/ctdb/conf/ctdb_config.h @@ -20,7 +20,7 @@ #ifndef __CTDB_CONFIG_H__ #define __CTDB_CONFIG_H__ -#include "common/conf.h" +#include "conf/conf.h" struct ctdb_config { /* Cluster */ @@ -54,6 +54,6 @@ struct ctdb_config { extern struct ctdb_config ctdb_config; -int ctdbd_config_load(TALLOC_CTX *mem_ctx, struct conf_context **conf); +int ctdb_config_load(TALLOC_CTX *mem_ctx, struct conf_context **conf); #endif /* __CTDB_CONFIG_H__ */ diff --git a/ctdb/database/database_conf.c b/ctdb/conf/database_conf.c similarity index 98% rename from ctdb/database/database_conf.c rename to ctdb/conf/database_conf.c index 4c7cb2d9ffe..2d0d705ed4a 100644 --- a/ctdb/database/database_conf.c +++ b/ctdb/conf/database_conf.c @@ -29,10 +29,10 @@ #include "lib/util/debug.h" #include "lib/util/samba_util.h" -#include "common/conf.h" #include "common/path.h" -#include "database_conf.h" +#include "conf/conf.h" +#include "conf/database_conf.h" #define DATABASE_CONF_VOLATILE_DB_DIR_DEFAULT CTDB_VARDIR "/volatile" #define DATABASE_CONF_PERSISTENT_DB_DIR_DEFAULT CTDB_VARDIR "/persistent" diff --git a/ctdb/database/database_conf.h b/ctdb/conf/database_conf.h similarity index 98% rename from ctdb/database/database_conf.h rename to ctdb/conf/database_conf.h index 6fa579c1502..e8baffd578d 100644 --- a/ctdb/database/database_conf.h +++ b/ctdb/conf/database_conf.h @@ -20,7 +20,7 @@ #ifndef __CTDB_DATABASE_CONF_H__ #define __CTDB_DATABASE_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define DATABASE_CONF_SECTION "database" diff --git a/ctdb/event/event_conf.c b/ctdb/conf/event_conf.c similarity index 97% rename from ctdb/event/event_conf.c rename to ctdb/conf/event_conf.c index 61ecf8e33eb..6b2aeb76c28 100644 --- a/ctdb/event/event_conf.c +++ b/ctdb/conf/event_conf.c @@ -23,10 +23,10 @@ #include "lib/util/debug.h" -#include "common/conf.h" #include "common/path.h" -#include "event/event_conf.h" +#include "conf/conf.h" +#include "conf/event_conf.h" static bool event_conf_validate_debug_script(const char *key, const char *old_script, diff --git a/ctdb/event/event_conf.h b/ctdb/conf/event_conf.h similarity index 97% rename from ctdb/event/event_conf.h rename to ctdb/conf/event_conf.h index 964a18a077e..177307b7209 100644 --- a/ctdb/event/event_conf.h +++ b/ctdb/conf/event_conf.h @@ -20,7 +20,7 @@ #ifndef __CTDB_EVENT_CONF_H__ #define __CTDB_EVENT_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define EVENT_CONF_SECTION "event" diff --git a/ctdb/failover/failover_conf.c b/ctdb/conf/failover_conf.c similarity index 95% rename from ctdb/failover/failover_conf.c rename to ctdb/conf/failover_conf.c index 0f199cbcd6c..3f9f749fcae 100644 --- a/ctdb/failover/failover_conf.c +++ b/ctdb/conf/failover_conf.c @@ -21,9 +21,9 @@ #include "lib/util/debug.h" -#include "common/conf.h" +#include "conf/conf.h" -#include "failover/failover_conf.h" +#include "conf/failover_conf.h" static bool check_static_boolean_change(const char *key, bool old_value, diff --git a/ctdb/failover/failover_conf.h b/ctdb/conf/failover_conf.h similarity index 97% rename from ctdb/failover/failover_conf.h rename to ctdb/conf/failover_conf.h index d154daa3428..d7ac0ac507d 100644 --- a/ctdb/failover/failover_conf.h +++ b/ctdb/conf/failover_conf.h @@ -20,7 +20,7 @@ #ifndef __CTDB_FAILOVER_CONF_H__ #define __CTDB_FAILOVER_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define FAILOVER_CONF_SECTION "failover" diff --git a/ctdb/server/legacy_conf.c b/ctdb/conf/legacy_conf.c similarity index 97% rename from ctdb/server/legacy_conf.c rename to ctdb/conf/legacy_conf.c index 3391a3bdb54..f892d78ea58 100644 --- a/ctdb/server/legacy_conf.c +++ b/ctdb/conf/legacy_conf.c @@ -21,10 +21,10 @@ #include "lib/util/debug.h" -#include "common/conf.h" #include "common/logging.h" -#include "legacy_conf.h" +#include "conf/conf.h" +#include "conf/legacy_conf.h" #define LEGACY_SCRIPT_LOG_LEVEL_DEFAULT "ERROR" diff --git a/ctdb/server/legacy_conf.h b/ctdb/conf/legacy_conf.h similarity index 97% rename from ctdb/server/legacy_conf.h rename to ctdb/conf/legacy_conf.h index b6b4b5738f6..99a06efdc1a 100644 --- a/ctdb/server/legacy_conf.h +++ b/ctdb/conf/legacy_conf.h @@ -20,7 +20,7 @@ #ifndef __CTDB_LEGACY_CONF_H__ #define __CTDB_LEGACY_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define LEGACY_CONF_SECTION "legacy" diff --git a/ctdb/common/logging_conf.c b/ctdb/conf/logging_conf.c similarity index 98% rename from ctdb/common/logging_conf.c rename to ctdb/conf/logging_conf.c index 38b3003a3f7..fb1c3735c0e 100644 --- a/ctdb/common/logging_conf.c +++ b/ctdb/conf/logging_conf.c @@ -21,9 +21,10 @@ #include <talloc.h> -#include "common/conf.h" #include "common/logging.h" -#include "common/logging_conf.h" + +#include "conf/conf.h" +#include "conf/logging_conf.h" #define LOGGING_LOCATION_DEFAULT "file:" LOGDIR "/log.ctdb" #define LOGGING_LOG_LEVEL_DEFAULT "NOTICE" diff --git a/ctdb/common/logging_conf.h b/ctdb/conf/logging_conf.h similarity index 97% rename from ctdb/common/logging_conf.h rename to ctdb/conf/logging_conf.h index fab478df2f6..8f8d1062d48 100644 --- a/ctdb/common/logging_conf.h +++ b/ctdb/conf/logging_conf.h @@ -20,7 +20,7 @@ #ifndef __LOGGING_CONF_H__ #define __LOGGING_CONF_H__ -#include "common/conf.h" +#include "conf/conf.h" #define LOGGING_CONF_SECTION "logging" diff --git a/ctdb/event/event_config.c b/ctdb/event/event_config.c index d2826225c80..8617ebaad30 100644 --- a/ctdb/event/event_config.c +++ b/ctdb/event/event_config.c @@ -21,12 +21,13 @@ #include <talloc.h> -#include "common/conf.h" -#include "common/logging_conf.h" #include "common/path.h" +#include "conf/conf.h" +#include "conf/logging_conf.h" +#include "conf/event_conf.h" + #include "event/event_private.h" -#include "event/event_conf.h" struct event_config { char *config_file; diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c index e2cb9165c71..8d03062b97a 100644 --- a/ctdb/server/ctdb_ltdb_server.c +++ b/ctdb/server/ctdb_ltdb_server.c @@ -41,7 +41,7 @@ #include "common/common.h" #include "common/logging.h" -#include "server/ctdb_config.h" +#include "conf/ctdb_config.h" #define PERSISTENT_HEALTH_TDB "persistent_health.tdb" diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 0bcc4d33f8d..3f71c07d05d 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -44,7 +44,7 @@ #include "common/common.h" #include "common/logging.h" -#include "server/ctdb_config.h" +#include "conf/ctdb_config.h" #include "ctdb_cluster_mutex.h" diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 0f7ac756497..2176c6ab806 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -45,7 +45,7 @@ #include "common/common.h" #include "common/logging.h" -#include "server/ctdb_config.h" +#include "conf/ctdb_config.h" #include "server/ipalloc.h" diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index a388bff1598..67311c6a5da 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -40,9 +40,9 @@ #include "common/common.h" #include "common/path.h" #include "common/logging.h" -#include "common/logging_conf.h" -#include "ctdb_config.h" +#include "conf/logging_conf.h" +#include "conf/ctdb_config.h" int script_log_level; bool fast_start; @@ -232,9 +232,9 @@ int main(int argc, const char *argv[]) * Configuration file handling */ - ret = ctdbd_config_load(ctdb, &conf); + ret = ctdb_config_load(ctdb, &conf); if (ret != 0) { - /* ctdbd_config_load() logs the failure */ + /* ctdb_config_load() logs the failure */ goto fail; } diff --git a/ctdb/tests/src/conf_test.c b/ctdb/tests/src/conf_test.c index 9b3bd8f0cc1..a38a51bf37e 100644 --- a/ctdb/tests/src/conf_test.c +++ b/ctdb/tests/src/conf_test.c @@ -21,7 +21,7 @@ #include <assert.h> -#include "common/conf.c" +#include "conf/conf.c" static void test1(void) { diff --git a/ctdb/wscript b/ctdb/wscript index 3fbdf7d0425..a557d0a872e 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -437,7 +437,6 @@ def build(bld): source=bld.SUBDIR('common', '''cmdline.c comm.c - conf.c db_hash.c event_script.c hash_count.c @@ -466,10 +465,6 @@ def build(bld): popt ''') - bld.SAMBA_SUBSYSTEM('ctdb-logging-conf', - source='common/logging_conf.c', - deps='ctdb-util talloc') - bld.SAMBA_SUBSYSTEM('ctdb-protocol-basic', source=bld.SUBDIR('protocol', 'protocol_basic.c'), deps='talloc tdb') @@ -534,35 +529,22 @@ def build(bld): deps='''ctdb-util samba-util talloc replace popt''', install_path='${CTDB_HELPER_BINDIR}') - bld.SAMBA_SUBSYSTEM('ctdb-cluster-conf', - source='cluster/cluster_conf.c', - deps='ctdb-util') - - bld.SAMBA_SUBSYSTEM('ctdb-database-conf', - source='database/database_conf.c', - deps='ctdb-util') - - bld.SAMBA_SUBSYSTEM('ctdb-event-conf', - source='event/event_conf.c', - deps='ctdb-util') - - bld.SAMBA_SUBSYSTEM('ctdb-failover-conf', - source='failover/failover_conf.c', - deps='ctdb-util') - - bld.SAMBA_SUBSYSTEM('ctdb-legacy-conf', - source='server/legacy_conf.c', - deps='ctdb-util') + bld.SAMBA_SUBSYSTEM('ctdb-conf', + source='''conf/conf.c + conf/logging_conf.c + conf/cluster_conf.c + conf/database_conf.c + conf/event_conf.c + conf/failover_conf.c + conf/legacy_conf.c + conf/ctdb_config.c + ''', + deps='''ctdb-util talloc replace''') bld.SAMBA_BINARY('ctdb-config', - source='common/conf_tool.c', -- Samba Shared Repository