cluster: STABLE32 - rgmanager: Add a utility to dump the cpglockd state

Ryan McCabe rmccabe at fedoraproject.org
Tue May 1 13:43:35 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=096fe8d673933d2830aa0d6f37de9f863200a823
Commit:        096fe8d673933d2830aa0d6f37de9f863200a823
Parent:        d93069e4fc9905a9f4bd417605907d208fb91a80
Author:        Ryan McCabe <rmccabe at redhat.com>
AuthorDate:    Mon Apr 23 10:55:58 2012 -0400
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Apr 24 17:04:09 2012 +0200

rgmanager: Add a utility to dump the cpglockd state

Signed-off-by: Ryan McCabe <rmccabe at redhat.com>
---
 rgmanager/src/daemons/Makefile      |   10 ++++++++--
 rgmanager/src/daemons/cpglockdump.c |    8 ++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/rgmanager/src/daemons/Makefile b/rgmanager/src/daemons/Makefile
index 61ae6e4..336b6cf 100644
--- a/rgmanager/src/daemons/Makefile
+++ b/rgmanager/src/daemons/Makefile
@@ -2,11 +2,12 @@ TARGET1= rgmanager
 TARGET2= rg_test
 TARGET3= clurgmgrd
 TARGET4= cpglockd
+TARGET5= cpglockdump
 
-SBINDIRT=$(TARGET1) $(TARGET2) $(TARGET4)
+SBINDIRT=$(TARGET1) $(TARGET2) $(TARGET4) $(TARGET5)
 SBINSYMT=$(TARGET3)
 
-all: depends ${TARGET1} ${TARGET2} ${TARGET3} $(TARGET4)
+all: depends ${TARGET1} ${TARGET2} ${TARGET3} $(TARGET4) $(TARGET5)
 
 include ../../../make/defines.mk
 include $(OBJDIR)/make/cobj.mk
@@ -44,6 +45,8 @@ OBJS2=	test-noccs.o \
 
 OBJS4=  cpglockd.o
 
+OBJS5=	cpglockdump.o
+
 CFLAGS += -DSHAREDIR=\"${sharedir}\" -D_GNU_SOURCE
 CFLAGS += -fPIC
 CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} -I${logtincdir}
@@ -105,6 +108,9 @@ ${TARGET4}: ${OBJS4} ${LDDEPS}
 	$(CC) -o $@ $^ $(CPG_LDFLAGS) $(CMAN_LDFLAGS) $(CCS_LDFLAGS) \
 			$(FENCED_LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS)
 
+${TARGET5}: ${OBJS5} ${LDDEPS}
+	$(CC) -o $@ $^ $(CPG_LDFLAGS)
+
 check: rg_test
 	cd tests && ./runtests.sh
 
diff --git a/rgmanager/src/daemons/cpglockdump.c b/rgmanager/src/daemons/cpglockdump.c
new file mode 100644
index 0000000..2750e4a
--- /dev/null
+++ b/rgmanager/src/daemons/cpglockdump.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include <cpglock.h>
+
+int
+main(int argc, char **argv)
+{
+	return cpg_lock_dump(stdout);
+}


More information about the cluster-commits mailing list