forked from pool/ocfs2-tools
ab40e465fc
- Make mount.ocfs2 load modules and write cluster_stack: + 0007-mount.ocfs2-performs-module-loading-cluster_stack-se.patch - Mark o2cb.ocf as obsolete. Anyone using o2cb.ocf will get an info message stating so. - The nocontrold effort (added nocontrold patches and disabled corosync-2.3 controld compatibility patches): + 0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch + 0002-libo2cb-Remove-rest-of-controld-functions.patch + 0003-Get-cluster-name-from-corosync-cmap.patch + 0004-Remove-controld-structures-from-debugfs.ocfs2.patch + 0005-Check-for-DLM-kernel-version-in-user_begin_group_joi.patch + 0006-Add-cmap-and-dlm-libraries-in-the-tools.patch - 0001-Remove-pacemaker-ais-stuff.patch - 0002-Add-corosync-cfg-to-get-configuration-information.patch - 0003-Remove-daemon-protocol-versions-and-consolidate-fs-v.patch - 0005-Add-cluster_name-and-stack-name.patch - libocfs2-Change-asserts-to-error.patch: Return control to fsck.ocfs2 instead of erring OBS-URL: https://build.opensuse.org/request/show/196156 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=64
63 lines
1.5 KiB
Diff
63 lines
1.5 KiB
Diff
From 3f2b73105c5e09e17744ec249eed93c60124bd2d Mon Sep 17 00:00:00 2001
|
|
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
|
Date: Mon, 19 Aug 2013 18:05:04 -0500
|
|
Subject: [PATCH 3/7] Get cluster name from corosync cmap
|
|
|
|
---
|
|
libo2cb/o2cb_abi.c | 20 ++++++++++++++++++++
|
|
o2cb.pc.in | 2 +-
|
|
2 files changed, 21 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
|
|
index 8e5d6ce..d00dd46 100644
|
|
--- a/libo2cb/o2cb_abi.c
|
|
+++ b/libo2cb/o2cb_abi.c
|
|
@@ -37,6 +37,7 @@
|
|
#include <ctype.h>
|
|
|
|
#include <linux/types.h>
|
|
+#include <corosync/cmap.h>
|
|
|
|
#include "o2cb/o2cb.h"
|
|
#include "o2cb/o2cb_client_proto.h"
|
|
@@ -1711,6 +1712,25 @@ static errcode_t classic_list_clusters(char ***clusters)
|
|
|
|
static errcode_t user_list_clusters(char ***clusters)
|
|
{
|
|
+ cmap_handle_t handle;
|
|
+ char **list;
|
|
+ int rv;
|
|
+
|
|
+ rv = cmap_initialize(&handle);
|
|
+ if (rv != CS_OK)
|
|
+ return O2CB_ET_SERVICE_UNAVAILABLE;
|
|
+
|
|
+ /* We supply only one cluster_name */
|
|
+ list = (char **)malloc(sizeof(char *) * 2);
|
|
+ rv = cmap_get_string(handle, "totem.cluster_name", &list[0]);
|
|
+ if (rv != CS_OK) {
|
|
+ free(list);
|
|
+ return O2CB_ET_INTERNAL_FAILURE;
|
|
+ }
|
|
+
|
|
+ list[1] = NULL;
|
|
+ *clusters = list;
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
diff --git a/o2cb.pc.in b/o2cb.pc.in
|
|
index be94b8a..3a47c36 100644
|
|
--- a/o2cb.pc.in
|
|
+++ b/o2cb.pc.in
|
|
@@ -7,5 +7,5 @@ Name: o2cb
|
|
Description: Library for accessing the ocfs2 cluster base (o2cb)
|
|
Version: @VERSION@
|
|
Requires: com_err
|
|
-Libs: -L${libdir} -lo2cb
|
|
+Libs: -L${libdir} -lo2cb -lcmap
|
|
Cflags: -I${includedir}
|
|
--
|
|
1.8.1.4
|
|
|