This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - cman: Set disallowed & two_node if needed


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0b3fd077414b0e61d2c2b12c3d2f1b496755cff6
Commit:        0b3fd077414b0e61d2c2b12c3d2f1b496755cff6
Parent:        cfe170aac9abd399f73f17eea1536cd03bdae834
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Fri Jan 9 10:46:10 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Fri Jan 9 10:46:10 2009 +0000

cman: Set disallowed & two_node if needed

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/config/cman-preconfig.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/cman/config/cman-preconfig.c b/cman/config/cman-preconfig.c
index f9aaefd..26ead90 100644
--- a/cman/config/cman-preconfig.c
+++ b/cman/config/cman-preconfig.c
@@ -651,6 +651,7 @@ static void add_cman_overrides(struct objdb_iface_ver0 *objdb)
 	char *logfacility;
 	unsigned int object_handle;
 	unsigned int find_handle;
+	unsigned int tmpint;
 	char tmp[256];
 
 	/* "totem" key already exists, because we have added the interfaces by now */
@@ -805,11 +806,6 @@ static void add_cman_overrides(struct objdb_iface_ver0 *objdb)
 		objdb->object_key_create(object_handle, "cluster_id", strlen("cluster_id"),
 					 str, strlen(str) + 1);
 
-		if (two_node) {
-			sprintf(str, "%d", 1);
-			objdb->object_key_create(object_handle, "two_node", strlen("two_node"),
-						 str, strlen(str) + 1);
-		}
 		if (debug_mask) {
 			sprintf(str, "%d", debug_mask);
 			objdb->object_key_create(object_handle, "debug_mask", strlen("debug_mask"),
@@ -846,8 +842,20 @@ static void add_cman_overrides(struct objdb_iface_ver0 *objdb)
 
 	sprintf(tmp, "%d", node_votes);
 	objdb->object_key_create(object_handle, "votes", strlen("votes"),
-				    tmp, strlen(tmp)+1);
+				 tmp, strlen(tmp)+1);
 
+
+	/* Disallowed can be disabled in cluster.conf by setting it to zero */
+	objdb_get_int(objdb, object_handle, "disallowed", &tmpint, 999);
+	if (tmpint == 999) { /* Value was not set by the user ... */
+		objdb->object_key_create(object_handle, "disallowed", strlen("disallowed"),
+					 "1", strlen("1") + 1);
+	}
+
+	if (two_node) {
+		objdb->object_key_create(object_handle, "two_node", strlen("two_node"),
+					 "1", strlen("1") + 1);
+	}
 }
 
 /* If ccs is not available then use some defaults */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]