ocfs2-tools/ocfs2_controld-pacemaker.diff
Yan Gao 086555113f - ocfs2_controld: ocfs2_controld-pacemaker.diff
* Replace use of send_ais_text() with send_cluster_text()
  * Replace use of ais_dispatch() with plugin_dispatch()

OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=59
2013-07-22 10:57:08 +00:00

68 lines
2.0 KiB
Diff

Index: ocfs2-tools/ocfs2_controld/pacemaker.c
===================================================================
--- ocfs2-tools.orig/ocfs2_controld/pacemaker.c
+++ ocfs2-tools/ocfs2_controld/pacemaker.c
@@ -28,9 +28,8 @@
#define SUPPORT_HEARTBEAT 0
#include <pacemaker/crm/crm.h>
-#include <pacemaker/crm/ais.h>
-#include <pacemaker/crm/common/cluster.h>
-#include <pacemaker/crm/common/stack.h>
+#include <pacemaker/crm/cluster.h>
+#include <pacemaker/crm/cluster/plugin.h>
#include <pacemaker/crm/common/ipc.h>
#include <pacemaker/crm/msg_xml.h>
@@ -47,6 +46,7 @@ static char * clustername = "pacemaker"
extern struct list_head mounts;
const char *stackname = "pcmk";
+static crm_cluster_t crm_cluster;
extern int ais_fd_async;
char *local_node_uname = NULL;
@@ -138,33 +138,34 @@ static void dead_pcmk(int ci)
connection_dead(ci);
}
-extern void terminate_ais_connection(void);
-
void exit_stack(void)
{
log_debug("closing pacemaker connection");
- terminate_ais_connection();
+ crm_cluster_disconnect(&crm_cluster);
}
static void process_pcmk(int ci)
{
- ais_dispatch(ais_fd_async, NULL);
+ plugin_dispatch(&crm_cluster);
}
int setup_stack(void)
{
- crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL);
+ crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL, FALSE);
- if(init_ais_connection(NULL, NULL, NULL, &local_node_uname, &our_nodeid) == FALSE) {
+ if(crm_cluster_connect(&crm_cluster) == FALSE) {
log_error("Connection to our AIS plugin (CRM) failed");
return -1;
}
+ local_node_uname = crm_cluster.uname;
+ our_nodeid = crm_cluster.nodeid;
+
/* Sign up for membership updates */
- send_ais_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais);
+ send_cluster_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais);
/* Requesting the current list of known nodes */
- send_ais_text(crm_class_members, __FUNCTION__, TRUE, NULL, crm_msg_ais);
+ send_cluster_text(crm_class_members, __FUNCTION__, TRUE, NULL, crm_msg_ais);
log_debug("Cluster connection established. Local node id: %d", our_nodeid);