Skip to contentSkip to conversation

Cluster Project branch, master, updated. gfs-kernel_0_1_22-207-g8170e8d

Cluster-devel [email protected] 1 participant 1 message Apr 24, 2008

lore
Share & tools
lore
#0 lore raw

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=8170e8d76373ffa1d7e2beaffd5b86a120a14de6

The branch, master has been updated

       via  8170e8d76373ffa1d7e2beaffd5b86a120a14de6 (commit)
      from  0083f20653ffa93bbbfc107d4a4f5d56bfae0252 (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

- Log ----------------------------------------------------------------- commit 8170e8d76373ffa1d7e2beaffd5b86a120a14de6

Author: David Teigland <[email protected]>
Date:   Thu Apr 24 15:18:27 2008 -0500

fenced: new libfenced interface

A new library, libfenced, is used to communicate with fenced. Previously, programs would each open fenced's local socket and write/read strings.

-----------------------------------------------------------------------

Summary of changes:

 fence/fence_node/Makefile                       |    4 +-
 fence/fence_node/fence_node.c                   |    5 +
 fence/fence_tool/Makefile                       |    4 +-
 fence/fence_tool/fence_tool.c                   |  122 ++-------
 fence/fenced/Makefile                           |    2 +-
 fence/fenced/cpg.c                              |   16 ++
 fence/fenced/fd.h                               |   10 +-
 fence/fenced/fenced.h                           |   29 ++-
 fence/fenced/group.c                            |   16 ++
 fence/fenced/main.c                             |  280 +++++++++++++-------
 fence/{lib => libfenced}/Makefile               |    9 +-
 fence/{lib/libfence.h => libfenced/libfenced.h} |   37 ++-
 fence/libfenced/main.c                          |  327 +++++++++++++++++++++++
 13 files changed, 639 insertions(+), 222 deletions(-)
 copy fence/{lib => libfenced}/Makefile (92%)
 copy fence/{lib/libfence.h => libfenced/libfenced.h} (62%)
 create mode 100644 fence/libfenced/main.c
fence/fence_node/Makefile +2 -2
index b076479..c4dede7 100644
@@ -29,9 +29,9 @@ CFLAGS += -D_FILE_OFFSET_BITS=64
 
 CFLAGS += -I${ccsincdir} -I${fenceincdir}
 CFLAGS += -I../include
-CFLAGS += -I${incdir}
+CFLAGS += -I${incdir} -I../libfenced
 
-LDFLAGS += -L${ccslibdir} -L${fencelibdir} -lccs -lfence
+LDFLAGS += -L${ccslibdir} -L${fencelibdir} -lccs -lfence -lfenced
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
fence/fence_node/fence_node.c +5 -0
index ad1234c..6662f52 100644
@@ -14,10 +14,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <stdint.h>
 #include <string.h>
 #include <syslog.h>
 
 #include "libfence.h"
+#include "libfenced.h"
 #include "copyright.cf"
 
 #define OPTION_STRING           ("huV")
@@ -105,6 +107,9 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	} else {
 		syslog(LOG_NOTICE, "Fence of \"%s\" was successful\n", victim);
+
+		fenced_external(victim);
+
 		exit(EXIT_SUCCESS);
 	}
 }
fence/fence_tool/Makefile +2 -2
index 868a439..cd64b96 100644
@@ -28,10 +28,10 @@ OBJS=fence_tool.o
 CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -I${ccsincdir} -I${cmanincdir}
 CFLAGS += -I$(S)/../include -I$(SRCDIR)/group/lib
-CFLAGS += -I${incdir}
+CFLAGS += -I${incdir} -I../libfenced
 
 LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
-LDFLAGS += -L../../group/lib -lgroup
+LDFLAGS += -L../../group/lib -lgroup -lfenced
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
fence/fence_tool/fence_tool.c +22 -100

239 lines not on this page · raw message

fence/fenced/Makefile +1 -1
index bc94f39..5a39356 100644
@@ -33,7 +33,7 @@ OBJS=	config.o \
 CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${fenceincdir} -I${openaisincdir}
 CFLAGS += -I$(S) -I$(S)/../include -I$(SRCDIR)/group/lib
-CFLAGS += -I${incdir}
+CFLAGS += -I${incdir} -I../libfenced
 
 LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -L${openaislibdir} -lccs -lcman -lcpg
 LDFLAGS += -L${fencelibdir} -L${openaislibdir} -lfence -lcpg
fence/fenced/cpg.c +16 -0
index e0b9685..0ab6a60 100644
@@ -1247,3 +1247,19 @@ int fd_leave(struct fd *fd)
 	return 0;
 }
 
+int set_node_info(struct fd *fd, int nodeid, struct fenced_node *node)
+{
+	return 0;
+}
+
+int set_domain_info(struct fd *fd, struct fenced_domain *domain)
+{
+	return 0;
+}
+
+int set_domain_members(struct fd *fd, int *member_count,
+		       struct fenced_node **members)
+{
+	return 0;
+}
+
fence/fenced/fd.h +9 -1
index 3765db1..605cb1b 100644
@@ -30,7 +30,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
-#include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/poll.h>
 #include <sys/select.h>
@@ -42,6 +41,7 @@
 #include "list.h"
 #include "linux_endian.h"
 #include "libfence.h"
+#include "libfenced.h"
 #include "fenced.h"
 
 /* Max name length for a group, pointless since we only ever create the
@@ -239,6 +239,10 @@ void send_victim_done(struct fd *fd, int victim, int how);
 void process_fd_changes(void);
 int fd_join(struct fd *fd);
 int fd_leave(struct fd *fd);
+int set_node_info(struct fd *fd, int nodeid, struct fenced_node *node);
+int set_domain_info(struct fd *fd, struct fenced_domain *domain);
+int set_domain_members(struct fd *fd, int *member_count,
+	struct fenced_node **members);
 
 /* group.c */
 
@@ -246,6 +250,10 @@ void process_groupd(int ci);
 int setup_groupd(void);
 int fd_join_group(struct fd *fd);
 int fd_leave_group(struct fd *fd);
+int set_node_info_group(struct fd *fd, int nodeid, struct fenced_node *node);
+int set_domain_info_group(struct fd *fd, struct fenced_domain *domain);
+int set_domain_members_group(struct fd *fd, int *member_count,
+	struct fenced_node **members);
 
 /* main.c */
 
fence/fenced/fenced.h +27 -2
index 737c3cd..3b25814 100644
@@ -13,8 +13,33 @@
 #ifndef __FENCED_DOT_H__
 #define __FENCED_DOT_H__
 
-#define FENCED_SOCK_PATH	"fenced_socket"
-#define FENCED_MSGLEN		256
+/* This defines the interface between fenced and libfenced, and should
+   only be used by libfenced. */
+
+/* should match the same in fd.h */
+#define MAX_NODENAME_LEN		255
+
+#define FENCED_SOCK_PATH		"fenced_socket"
+
+#define FENCED_MAGIC			0x0FE11CED
+#define FENCED_VERSION			0x00010001
+
+#define FENCED_CMD_JOIN			1
+#define FENCED_CMD_LEAVE		2
+#define FENCED_CMD_DUMP_DEBUG		3
+#define FENCED_CMD_EXTERNAL		4
+#define FENCED_CMD_NODE_INFO		5
+#define FENCED_CMD_DOMAIN_INFO		6
+#define FENCED_CMD_DOMAIN_MEMBERS	7
+
+struct fenced_header {
+	unsigned int magic;
+	unsigned int version;
+	unsigned int command;
+	unsigned int pad;
+	unsigned int len;
+	int data;	/* embedded command-specific data, for convenience */
+};
 
 #endif
 
fence/fenced/group.c +16 -0
index 92386fe..01db901 100644
@@ -411,3 +411,19 @@ int fd_leave_group(struct fd *fd)
 	return rv;
 }
 
+int set_node_info_group(struct fd *fd, int nodeid, struct fenced_node *node)
+{
+	return 0;
+}
+
+int set_domain_info_group(struct fd *fd, struct fenced_domain *domain)
+{
+	return 0;
+}
+
+int set_domain_members_group(struct fd *fd, int *member_count,
+			     struct fenced_node **members)
+{
+	return 0;
+}
+
fence/fenced/main.c +181 -99

313 lines not on this page · raw message

fence/libfenced/Makefile renamed from fence/lib/Makefile +3 -6
similarity index 92%
copy from fence/lib/Makefile
copy to fence/libfenced/Makefile
index 94a5064..0d500f5 100644
@@ -10,7 +10,7 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= libfence
+TARGET= libfenced
 
 LIBDIRT=$(TARGET).a \
 	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
@@ -32,13 +32,10 @@ include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	agent.o
+OBJS=	main.o
 
 CFLAGS += -fPIC
-CFLAGS += -I${ccsincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${ccslibdir} -lccs
+CFLAGS += -I${incdir} -I../fenced
 
 $(TARGET).a: $(OBJS)
 	${AR} r $@ $^
fence/libfenced/libfenced.h renamed from fence/lib/libfence.h +28 -9
similarity index 62%
copy from fence/lib/libfence.h
copy to fence/libfenced/libfenced.h
index 6cdbd85..b10055b 100644
@@ -20,17 +20,36 @@
 *******************************************************************************
 ******************************************************************************/
 
-#ifndef _LIBFENCE_H_
-#define _LIBFENCE_H_
+#ifndef _LIBFENCED_H_
+#define _LIBFENCED_H_
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#define FENCED_DUMP_SIZE (1024 * 1024)
 
-int fence_node(char *name);
+struct fenced_node {
+	int nodeid;
+	int member;
+	int victim;
+	int last_fenced_master;
+	int last_fenced_how;
+	uint64_t last_fenced_time;
+	uint64_t last_joined_time;
+	uint64_t last_remove_time;
+};
 
-#ifdef __cplusplus
-}
-#endif
+struct fenced_domain {
+	int member_count;
+	int victim_count;
+	int master_nodeid;
+	int current_victim;
+	int state;
+};
+
+int fenced_join(void);
+int fenced_leave(void);
+int fenced_dump_debug(char *buf);
+int fenced_external(char *name);
+int fenced_node_info(int nodeid, struct fenced_node *node);
+int fenced_domain_info(struct fenced_domain *domain);
+int fenced_domain_members(int max, int *count, struct fenced_node *members);
 
 #endif
fence/libfenced/main.c new file +327 -0

327 lines not on this page · raw message

hooks/post-receive
--
Cluster Project