From 04d32266b378f5f47088e8f34703bdd9c95f5a4c Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Thu, 30 Nov 2017 16:11:00 +0100
Subject: [PATCH] Build: cluster-servant: Compile with pacemaker-2.0
Pacemaker-2.0 removed support for corosync 1 cluster layer:
https://github.com/ClusterLabs/pacemaker/commit/7a9891f29
---
configure.ac | 4 ++++
src/sbd-cluster.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/configure.ac b/configure.ac
index 1eb8758..1f328c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,10 @@ AC_CHECK_HEADERS(pacemaker/crm/cluster.h)
AC_CHECK_LIB(crmcommon, pcmk_strerror, , missing="yes")
AC_CHECK_LIB(cib, cib_apply_patch_event, , missing="yes")
+dnl pacemaker-2.0 removed support for corosync 1 cluster layer
+AC_CHECK_DECLS([pcmk_cluster_classic_ais, pcmk_cluster_cman],,,
+ [#include <pacemaker/crm/cluster.h>])
+
if test "$missing" = "yes"; then
AC_MSG_ERROR([Missing required libraries or functions.])
fi
diff --git a/src/sbd-cluster.c b/src/sbd-cluster.c
index de99d0c..ae4750e 100644
--- a/src/sbd-cluster.c
+++ b/src/sbd-cluster.c
@@ -238,12 +238,16 @@ notify_timer_cb(gpointer data)
}
switch (get_cluster_type()) {
+#if HAVE_DECL_PCMK_CLUSTER_CLASSIC_AIS
case pcmk_cluster_classic_ais:
send_cluster_text(crm_class_quorum, NULL, TRUE, NULL, crm_msg_ais);
break;
+#endif
case pcmk_cluster_corosync:
+#if HAVE_DECL_PCMK_CLUSTER_CMAN
case pcmk_cluster_cman:
+#endif
/* TODO - Make a CPG call and only call notify_parent() when we get a reply */
notify_parent();
break;
--
1.8.3.1