Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fe1... Commit: fe16e2fea6085b4bc94c1cca0b5a2c021e9aff5c Parent: c939ac3799a7e5088e2225eabf1d93210fed875c Author: David Teigland teigland@redhat.com AuthorDate: Thu Jan 26 12:21:54 2012 -0600 Committer: David Teigland teigland@redhat.com CommitterDate: Thu Jan 26 12:21:54 2012 -0600
dlm_controld: add stonith calls
not used yet
Signed-off-by: David Teigland teigland@redhat.com --- dlm_controld/cpg.c | 12 ++++++------ dlm_controld/dlm_daemon.h | 1 + dlm_controld/fence.c | 38 +++++++++++++++----------------------- 3 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c index f490cf5..9a3134a 100644 --- a/dlm_controld/cpg.c +++ b/dlm_controld/cpg.c @@ -686,6 +686,11 @@ static int need_fencing(struct lockspace *ls) return 0; }
+/* we don't need to ask fenced to initiate fencing; it does + so itself when it sees a fence domain member fail. Without + fenced we'll probably need to ask another daemon to initiate + fencing, then check with it above, like we check libfenced. */ + static void request_fencing(struct lockspace *ls) { struct node *node; @@ -693,12 +698,7 @@ static void request_fencing(struct lockspace *ls) list_for_each_entry(node, &ls->node_history, list) { if (!node->request_fencing) continue; - - /* we don't need to ask fenced to initiate fencing; it does - so itself when it sees a fence domain member fail. Without - fenced we'll probably need to ask another daemon to initiate - fencing, then check with it above, like we check libfenced. */ - + fence_request(node->nodeid); node->request_fencing = 0; } } diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h index 497e6e8..3899550 100644 --- a/dlm_controld/dlm_daemon.h +++ b/dlm_controld/dlm_daemon.h @@ -348,6 +348,7 @@ void process_cluster_cfg(int ci); void kick_node_from_cluster(int nodeid);
/* fence.c */ +void fence_request(int nodeid); int fence_node_time(int nodeid, uint64_t *last_fenced_time); int fence_in_progress(int *count);
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c index 95a8bc1..f91d9de 100644 --- a/dlm_controld/fence.c +++ b/dlm_controld/fence.c @@ -7,38 +7,30 @@ */
#include "dlm_daemon.h" -//#include "libfenced.h" +#ifdef STONITH +#include <pacemaker/crm/stonith-ng.h> +#endif
-int fence_node_time(int nodeid, uint64_t *last_fenced_time) +void fence_request(int nodeid) { -/* - struct fenced_node nodeinfo; +#ifdef STONITH int rv; + rv = stonith_api_kick_cs_helper(nodeid, 300, 1); + if (rv) + log_error("stonith_api_kick_cs_helper %d error %d", nodeid, rv); +#endif +}
- memset(&nodeinfo, 0, sizeof(nodeinfo)); - - rv = fenced_node_info(nodeid, &nodeinfo); - if (rv < 0) - return rv; - - *last_fenced_time = nodeinfo.last_fenced_time; -*/ +int fence_node_time(int nodeid, uint64_t *last_fenced_time) +{ +#ifdef STONITH + *last_fenced_time = stonith_api_time_cs_helper(nodeid, 0); +#endif return 0; }
int fence_in_progress(int *count) { -/* struct fenced_domain domain; - int rv; - - memset(&domain, 0, sizeof(domain)); - - rv = fenced_domain_info(&domain); - if (rv < 0) - return rv; - - *count = domain.victim_count; -*/ return 0; }
cluster-commits@lists.fedorahosted.org