From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5328 invoked by alias); 4 Feb 2009 14:43:44 -0000 Received: (qmail 5321 invoked by alias); 4 Feb 2009 14:43:43 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com Subject: cluster: master - cman: Fix showing dead nodes in a config-less cluster To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 6f5b61f3e93595788cffe162994212572d348ca5 X-Git-Newrev: c4a768addd3891029c141a2ccdc9a2032c855412 From: Christine Caulfield Message-Id: <20090204144307.D19021205B2@lists.fedorahosted.org> Date: Wed, 04 Feb 2009 14:43:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00378.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c4a768addd3891029c141a2ccdc9a2032c855412 Commit: c4a768addd3891029c141a2ccdc9a2032c855412 Parent: 6f5b61f3e93595788cffe162994212572d348ca5 Author: Christine Caulfield AuthorDate: Wed Feb 4 14:42:42 2009 +0000 Committer: Christine Caulfield CommitterDate: Wed Feb 4 14:42:42 2009 +0000 cman: Fix showing dead nodes in a config-less cluster Signed-off-by: Christine Caulfield --- cman/services/cman/lib/libcman.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cman/services/cman/lib/libcman.c b/cman/services/cman/lib/libcman.c index 09ca151..148881f 100644 --- a/cman/services/cman/lib/libcman.c +++ b/cman/services/cman/lib/libcman.c @@ -1053,7 +1053,7 @@ int cman_get_nodes(cman_handle_t handle, int maxnodes, int *retnodes, cman_node_ int ccs_handle; char *value; int ret; - int i; + int i,j; int num_nodes = 0; char path[PATH_MAX]; int noconfig_flag=0; @@ -1086,7 +1086,6 @@ int cman_get_nodes(cman_handle_t handle, int maxnodes, int *retnodes, cman_node_ for (i=0; i < cman_inst->node_count; i++) { nodes[i].cn_nodeid = cman_inst->node_list[i].nodeid; - nodes[i].cn_member = 1; name = NULL; error = corosync_cfg_get_node_addrs(cman_inst->cfg_handle, nodes[i].cn_nodeid, max_addrs, &num_addrs, addrs); @@ -1099,6 +1098,14 @@ int cman_get_nodes(cman_handle_t handle, int maxnodes, int *retnodes, cman_node_ else { sprintf(nodes[i].cn_name, "Node-%x", nodes[i].cn_nodeid); } + + /* Reconcile with active nodes list. */ + for (j=0; j < cman_inst->node_count; j++) { + if (cman_inst->node_list[j].nodeid == nodes[i].cn_nodeid) { + nodes[i].cn_member = (cman_inst->node_list[j].state == NODESTATE_MEMBER); + } + } + } } else {