This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - cman: Set config_version to -1 when running with noconfig file
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Wed, 28 Jan 2009 14:38:08 +0000 (UTC)
- Subject: cluster: master - cman: Set config_version to -1 when running with noconfig file
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=14339c5ff2c3e435f0b8ea02007f71b9970a0f01
Commit: 14339c5ff2c3e435f0b8ea02007f71b9970a0f01
Parent: 8e8918f3d0db152a3c5705bca91bfd4945c0cafe
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Wed Jan 28 14:37:07 2009 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Jan 28 14:37:07 2009 +0000
cman: Set config_version to -1 when running with no config file
Also disable cman_tool version in that case.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/cman_tool/main.c | 5 +++++
cman/config/cman-preconfig.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c
index a6d5102..7f99207 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -589,6 +589,11 @@ static void version(commandline_t *comline)
if ((result = cman_get_version(h, &ver)))
die("can't get version: %s", cman_error(errno));
+ if (ver.cv_config == -1) {
+ printf("cman is running without a configuration file\n");
+ goto out;
+ }
+
if (!comline->config_version_opt) {
printf("%d.%d.%d config %d\n", ver.cv_major, ver.cv_minor, ver.cv_patch,
ver.cv_config);
diff --git a/cman/config/cman-preconfig.c b/cman/config/cman-preconfig.c
index fe57c45..338d896 100644
--- a/cman/config/cman-preconfig.c
+++ b/cman/config/cman-preconfig.c
@@ -963,7 +963,7 @@ static int set_noccs_defaults(struct objdb_iface_ver0 *objdb)
cluster_name, strlen(cluster_name)+1);
/* Add a dummy config_version */
- sprintf(tmp, "%d", 0);
+ sprintf(tmp, "%d", -1);
objdb->object_key_create(cluster_parent_handle, "config_version", strlen("config_version"),
tmp, strlen(tmp)+1);