public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - cman: Add a single compatibilty switch Date: Thu, 13 Aug 2009 07:04:00 -0000 [thread overview] Message-ID: <20090813070430.F326E1201AE@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=99b2899ede7e9b0b4b7429de58397f55786bac4a Commit: 99b2899ede7e9b0b4b7429de58397f55786bac4a Parent: b8a5fd9d99b933f95d80bbe9577371fa5e94bf82 Author: Christine Caulfield <ccaulfie@redhat.com> AuthorDate: Thu Aug 13 08:02:23 2009 +0100 Committer: Christine Caulfield <ccaulfie@redhat.com> CommitterDate: Thu Aug 13 08:02:23 2009 +0100 cman: Add a single compatibilty switch Adding the key <cluster upgrading="on"/> to cluster.conf will also enable the following: <cluster> <group groupd_compat="1"/> <clvmd interface="cman"/> <cman disallowed="1"/> </cluster> <totem> crypto_accept="old"/> </totem> Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> --- cman/daemon/cman-preconfig.c | 81 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 81 insertions(+), 0 deletions(-) diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c index 4cdd00d..f813ac7 100644 --- a/cman/daemon/cman-preconfig.c +++ b/cman/daemon/cman-preconfig.c @@ -1161,11 +1161,86 @@ err: return ret; } + +static hdb_handle_t find_or_create_object(struct objdb_iface_ver0 *objdb, const char *name, hdb_handle_t parent_handle) +{ + hdb_handle_t find_handle; + hdb_handle_t ret_handle = 0; + + objdb->object_find_create(parent_handle, name, strlen(name), &find_handle); + objdb->object_find_next(find_handle, &ret_handle); + objdb->object_find_destroy(find_handle); + + if (!ret_handle) { + objdb->object_create(parent_handle, &ret_handle, name, strlen(name)); + } + + return ret_handle; +} + +static const char *groupd_compat="groupd_compat"; +static const char *clvmd_interface="interface"; +static const char *cman_disallowed="disallowed"; +static const char *totem_crypto="crypto_accept"; + +/* + * Flags to set: + * - groupd: + * - clvmd + * - disallowed (on) + * - rgmanager + */ +static void setup_old_compat(struct objdb_iface_ver0 *objdb, hdb_handle_t cluster_handle) +{ + hdb_handle_t groupd_handle; + hdb_handle_t clvmd_handle; + hdb_handle_t cman_handle; + hdb_handle_t totem_handle; + char *value; + + /* Set groupd to backwards compatibility mode */ + groupd_handle = find_or_create_object(objdb, "group", cluster_handle); + if (objdb->object_key_get(groupd_handle, groupd_compat, strlen(groupd_compat), + (void *)&value, NULL) || + !value) { + objdb->object_key_create(groupd_handle, groupd_compat, strlen(groupd_compat), + "1", 2); + } + + /* Make clvmd use cman */ + clvmd_handle = find_or_create_object(objdb, "clvmd", cluster_handle); + if (objdb->object_key_get(clvmd_handle, clvmd_interface, strlen(clvmd_interface), + (void *)&value, NULL) || + !value) { + objdb->object_key_create(clvmd_handle, clvmd_interface, strlen(clvmd_interface), + "cman", 5); + } + + /* Make cman use disallowed mode */ + cman_handle = find_or_create_object(objdb, "cman", cluster_handle); + if (objdb->object_key_get(cman_handle, cman_disallowed, strlen(cman_disallowed), + (void *)&value, NULL) || + !value) { + objdb->object_key_create(cman_handle, cman_disallowed, strlen(cman_disallowed), + "1", 2); + } + + /* Make totem use the old communications method */ + totem_handle = find_or_create_object(objdb, "totem", OBJECT_PARENT_HANDLE); + if (objdb->object_key_get(totem_handle, totem_crypto, strlen(totem_crypto), + (void *)&value, NULL) || + !value) { + objdb->object_key_create(totem_handle, totem_crypto, strlen(totem_crypto), + "old", 4); + } +} + static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, const char **error_string) { int ret = 0; hdb_handle_t object_handle; hdb_handle_t find_handle; + char *str; if (getenv("CMAN_PIPE")) startup_pipe = atoi(getenv("CMAN_PIPE")); @@ -1194,6 +1269,12 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, const char **error } objdb->object_find_destroy(find_handle); + /* Set up STABLE2/RHEL5 compatibility modes */ + objdb_get_string(objdb, object_handle, "upgrading", &str); + if (str && strcasecmp(str, "on")==0) { + setup_old_compat(objdb, cluster_parent_handle); + } + /* This will create /libccs/@next_handle. * next_handle will be atomically incremented by corosync to return ccs_handle down the pipe. * We create it in cman-preconfig to avoid an "init" race in libccs.
reply other threads:[~2009-08-13 7:04 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090813070430.F326E1201AE@lists.fedorahosted.org \ --to=chrissie@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).