Skip to contentSkip to conversation

Cluster Project branch, master, updated. cluster-2.99.00-14-g0b62a9c

Cluster-devel [email protected] 1 participant 1 message May 2, 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=0b62a9cde0a0a5ad9d7cb2a55492bf5bb9a372e7

The branch, master has been updated

       via  0b62a9cde0a0a5ad9d7cb2a55492bf5bb9a372e7 (commit)
       via  4019c7162bcf3d8021780fff1f59e5afa6767185 (commit)
      from  41f2735e80acff590c08161e76ce0d25ca5e9c66 (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 0b62a9cde0a0a5ad9d7cb2a55492bf5bb9a372e7

Author: Fabio M. Di Nitto <[email protected]>
Date:   Fri May 2 12:43:34 2008 +0200

[CCS] Detach dependency on ccsd to run the cluster

The old static libccs is now called libccscompat and should not be used by anything outside ccs/. Note that the headers and the library are not installed, nor configure knows about it. All application paths that require compat are made static and non-configurable.

Allow ccsais and ccs_tool to use libccscompat.

Stop linking ccsd with libccs. It was not required before either.

Add new shared library called libccs that uses aisexec confdb directly. The new libccs retains API compatibility with the old library so it was possible to "unplug" the old and "plug" the new one in one go. All the applications in the stack are now quering aisexec db directly.

NOTES:
- the new library does not emulate all the libccscompat calls as some of them are not used anywhere but this is not a problem since libccs was static. We are shipping it now shared and we a new soname.
- the library implements only a small subset of xpath to query the aisexec config db.

Port ccs_test to use the new libccs and drop all calls that are not used anywhere.

Set new default ccsincdir and ccslibdir to ccs/libccsconfdb in configure.

NOTE to developers: you will need to rerun configure.

commit 4019c7162bcf3d8021780fff1f59e5afa6767185

Author: Fabio M. Di Nitto <[email protected]>
Date:   Fri May 2 10:46:23 2008 +0200

[CMAN] Do not query ccs as it might not be the right config plugin

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

Summary of changes:

 ccs/Makefile                                      |    2 +-
 ccs/ccs_test/Makefile                             |    2 +-
 ccs/ccs_test/ccs_test.c                           |   73 +--
 ccs/ccs_tool/Makefile                             |   11 +-
 ccs/ccs_tool/update.c                             |    2 +-
 ccs/ccsais/Makefile                               |    7 +-
 ccs/ccsais/config.c                               |    2 +-
 ccs/daemon/Makefile                               |    7 +-
 ccs/{lib => libccscompat}/Makefile                |    7 +-
 ccs/{lib/libccs.c => libccscompat/libccscompat.c} |    2 +-
 ccs/{lib/ccs.h => libccscompat/libccscompat.h}    |   12 +-
 {cman/lib => ccs/libccsconfdb}/Makefile           |   13 +-
 ccs/{lib => libccsconfdb}/ccs.h                   |    8 +-
 ccs/libccsconfdb/libccs.c                         |  575 +++++++++++++++++++++
 cman/cman_tool/Makefile                           |    4 +-
 cman/cman_tool/cman_tool.h                        |    4 +-
 cman/cman_tool/join.c                             |   14 +-
 cman/cman_tool/main.c                             |    9 +-
 cman/daemon/cman-preconfig.c                      |    2 +-
 configure                                         |    8 +-
 20 files changed, 648 insertions(+), 116 deletions(-)
 rename ccs/{lib => libccscompat}/Makefile (93%)
 rename ccs/{lib/libccs.c => libccscompat/libccscompat.c} (99%)
 copy ccs/{lib/ccs.h => libccscompat/libccscompat.h} (79%)
 copy {cman/lib => ccs/libccsconfdb}/Makefile (82%)
 rename ccs/{lib => libccsconfdb}/ccs.h (82%)
 create mode 100644 ccs/libccsconfdb/libccs.c
ccs/Makefile +1 -1
index 0bf7c8c..ed456a1 100644
@@ -13,4 +13,4 @@
 include ../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=lib daemon ccsais ccs_test ccs_tool man
+SUBDIRS=libccscompat libccsconfdb daemon ccsais ccs_test ccs_tool man
ccs/ccs_test/Makefile +1 -1
index 81a3298..8819828 100644
@@ -35,7 +35,7 @@ ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 depends:
-	$(MAKE) -C ../lib all
+	$(MAKE) -C ../libccsconfdb all
 
 clean: generalclean
 
ccs/ccs_test/ccs_test.c +18 -55

126 lines not on this page · raw message

ccs/ccs_tool/Makefile +6 -5
index a375a7e..ebb1e43 100644
@@ -1,7 +1,7 @@
 ###############################################################################
 ###############################################################################
 ##
-##  Copyright (C) 2005 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2005-2008 Red Hat, Inc.  All rights reserved.
 ##  
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -29,11 +29,12 @@ OBJS=	ccs_tool.o \
 	editconf.o
 
 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-CFLAGS += -I${ccsincdir} -I${cmanincdir} `xml2-config --cflags`
-CFLAGS += -I$(S)/../include
+CFLAGS += -I${cmanincdir} `xml2-config --cflags`
+CFLAGS += -I$(S)/../libccscompat -I$(S)/../include
 CFLAGS += -I${incdir}
 
-LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
+LDFLAGS += -L../libccscompat -lccscompat
+LDFLAGS += -L${cmanlibdir} -lcman
 LDFLAGS += `xml2-config --libs` -L${libdir}
 
 
@@ -41,7 +42,7 @@ ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 depends:
-	$(MAKE) -C ../lib all
+	$(MAKE) -C ../libccscompat all
 
 clean: generalclean
 
ccs/ccs_tool/update.c +1 -1
index 062c8b1..2009b90 100644
@@ -24,7 +24,7 @@
 #include <arpa/inet.h>
 
 #include "comm_headers.h"
-#include "ccs.h"
+#include "libccscompat.h"
 #include "libcman.h"
 
 typedef struct member_list {
ccs/ccsais/Makefile +4 -3
index 422b886..e53729c 100644
@@ -23,10 +23,11 @@ include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
 CFLAGS += -fPIC
-CFLAGS += -I${ccsincdir} -I${cmanincdir}/../daemon
+CFLAGS += -I$(S)/../libccscompat
+CFLAGS += -I${cmanincdir}/../daemon
 CFLAGS += -I${incdir}
 
-LDFLAGS += -L${ccslibdir} -lccs
+LDFLAGS += -L../libccscompat -lccscompat
 
 OBJS=	config.o
 
@@ -34,7 +35,7 @@ ${TARGET}: ${OBJS}
 	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
 
 depends:
-	$(MAKE) -C ../lib all
+	$(MAKE) -C ../libccscompat all
 
 clean: generalclean 
 
ccs/ccsais/config.c +1 -1
index fef4b2e..8639c55 100644
@@ -29,7 +29,7 @@
 #include <openais/lcr/lcr_comp.h>
 #include <openais/service/swab.h>
 
-#include "ccs.h"
+#include "libccscompat.h"
 #include "logging.h"
 
 #define CONFIG_VERSION_PATH	"/cluster/@config_version"
ccs/daemon/Makefile +2 -5
index e41aec5..21d8f13 100644
@@ -14,7 +14,7 @@ TARGET= ccsd
 
 SBINDIRT=$(TARGET)
 
-all: depends ${TARGET}
+all: ${TARGET}
 
 include ../../make/defines.mk
 include $(OBJDIR)/make/cobj.mk
@@ -33,7 +33,7 @@ CFLAGS += -I${cmanincdir} `xml2-config --cflags` -I${openaisincdir}
 CFLAGS += -I$(S) -I$(S)/../include -I$(S)/../common
 CFLAGS += -I${incdir}
 
-LDFLAGS += -L${cmanlibdir} -lcman -L${ccslibdir} -lccs
+LDFLAGS += -L${cmanlibdir} -lcman
 LDFLAGS += -L${openaislibdir} -llogsys
 LDFLAGS += -L${libdir} `xml2-config --libs` -lpthread
 
@@ -41,9 +41,6 @@ LDFLAGS += -L${libdir} `xml2-config --libs` -lpthread
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
-depends:
-	 $(MAKE) -C ../lib all
-
 clean: generalclean
 
 .PHONY: all ${TARGET}
ccs/libccscompat/Makefile renamed from ccs/lib/Makefile +2 -5
similarity index 93%
rename from ccs/lib/Makefile
rename to ccs/libccscompat/Makefile
index 820342f..0f5f2d9 100644
@@ -10,10 +10,7 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= libccs.a
-
-LIBDIRT=$(TARGET)
-INCDIRT=ccs.h
+TARGET= libccscompat.a
 
 all: ${TARGET}
 
@@ -23,7 +20,7 @@ include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	libccs.o
+OBJS=	libccscompat.o
 
 CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -fPIC
ccs/libccscompat/libccscompat.c renamed from ccs/lib/libccs.c +1 -1
similarity index 99%
rename from ccs/lib/libccs.c
rename to ccs/libccscompat/libccscompat.c
index ad566d8..b9144a1 100644
@@ -23,7 +23,7 @@
 
 #include "debug.h"
 #include "comm_headers.h"
-#include "ccs.h"
+#include "libccscompat.h"
 
 #include <stdio.h>
 
ccs/libccscompat/libccscompat.h renamed from ccs/lib/ccs.h +8 -4
similarity index 79%
copy from ccs/lib/ccs.h
copy to ccs/libccscompat/libccscompat.h
index 0ce58ff..ddd0c04 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 *******************************************************************************
 **
-**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -9,8 +9,12 @@
 **
 *******************************************************************************
 ******************************************************************************/
-#ifndef __CCS_DOT_H__
-#define __CCS_DOT_H__
+#ifdef __CCS_DOT_H__
+#error DO NOT INCLUDE libccscompat.h and ccs.h at the same time. it is BAD!
+#endif
+
+#ifndef __CCS_COMPAT_DOT_H__
+#define __CCS_COMPAT_DOT_H__
 
 int ccs_connect(void);
 int ccs_force_connect(char const *cluster_name, int blocking);
@@ -22,4 +26,4 @@ int ccs_get_state(int desc, char **cw_path, char **prev_query);
 int ccs_set_state(int desc, const char *cw_path, int reset_query);
 int ccs_lookup_nodename(int desc, const char *nodename, char **rtn);
 
-#endif /*  __CCS_DOT_H__ */
+#endif /*  __CCS_COMPAT_DOT_H__ */
ccs/libccsconfdb/Makefile renamed from cman/lib/Makefile +8 -5
similarity index 82%
copy from cman/lib/Makefile
copy to ccs/libccsconfdb/Makefile
index 13c6f6e..91bf214 100644
@@ -2,7 +2,7 @@
 ###############################################################################
 ##
 ##  Copyright (C) Sistina Software, Inc.  1997-2004  All rights reserved.
-##  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 ##  
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -11,7 +11,7 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= libcman
+TARGET= libccs
 
 LIBDIRT=$(TARGET).a \
 	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
@@ -19,7 +19,7 @@ LIBDIRT=$(TARGET).a \
 LIBSYMT=$(TARGET).so \
 	$(TARGET).so.$(SOMAJOR)
 
-INCDIRT=$(TARGET).h
+INCDIRT=ccs.h
 
 include ../../make/defines.mk
 
@@ -36,15 +36,18 @@ include $(OBJDIR)/make/uninstall.mk
 OBJS=	$(TARGET).o
 
 CFLAGS += -fPIC
-CFLAGS += -I${cmanincdir} -I$(S)/../daemon
+CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS += -I${openaisincdir}
 CFLAGS += -I${incdir}
 
+LDFLAGS += -L${openaislibdir} -lconfdb
+
 $(TARGET).a: $(OBJS)
 	${AR} r $@ $^
 	${RANLIB} $@
 
 $(TARGET).so.${SOMAJOR}.${SOMINOR}: $(OBJS)
-	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $<
+	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(LDFLAGS)
 	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
 	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
 
ccs/libccsconfdb/ccs.h renamed from ccs/lib/ccs.h +5 -3
similarity index 82%
rename from ccs/lib/ccs.h
rename to ccs/libccsconfdb/ccs.h
index 0ce58ff..91e63cd 100644
@@ -1,7 +1,7 @@
 /******************************************************************************
 *******************************************************************************
 **
-**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -9,6 +9,10 @@
 **
 *******************************************************************************
 ******************************************************************************/
+#ifdef __CCS_COMPAT_DOT_H__
+#error DO NOT INCLUDE libccscompat.h and ccs.h@the same time. it is BAD!
+#endif
+
 #ifndef __CCS_DOT_H__
 #define __CCS_DOT_H__
 
@@ -18,8 +22,6 @@ int ccs_disconnect(int desc);
 int ccs_get(int desc, const char *query, char **rtn);
 int ccs_get_list(int desc, const char *query, char **rtn);
 int ccs_set(int desc, const char *path, char *val);
-int ccs_get_state(int desc, char **cw_path, char **prev_query);
-int ccs_set_state(int desc, const char *cw_path, int reset_query);
 int ccs_lookup_nodename(int desc, const char *nodename, char **rtn);
 
 #endif /*  __CCS_DOT_H__ */
ccs/libccsconfdb/libccs.c new file +575 -0

575 lines not on this page · raw message

cman/cman_tool/Makefile +2 -2
index dc6f8cf..8fcf32f 100644
@@ -26,10 +26,10 @@ OBJS=	main.o \
 	join.o
 
 CFLAGS += -DAISEXECBIN=\"${aisexecbin}\"
-CFLAGS += -I${ccsincdir} -I${cmanincdir}
+CFLAGS += -I${cmanincdir}
 CFLAGS += -I${incdir}
 
-LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
+LDFLAGS += -L${cmanlibdir} -lcman
 
 
 ${TARGET}: ${OBJS}
cman/cman_tool/cman_tool.h +1 -3
index 8a98c12..9ebd810 100644
@@ -84,7 +84,6 @@ struct commandline
 	int two_node;
 	int port;
 	char clustername[MAX_CLUSTER_NAME_LEN];
-	int no_ccs;
 	int remove;
 	int force;
         int verbose;
@@ -102,13 +101,12 @@ struct commandline
 	int wait_quorate_opt;
 	int fence_opt;
 	int addresses_opt;
-	int noccs_opt;
+	int noconfig_opt;
 	int nosetpri_opt;
 };
 typedef struct commandline commandline_t;
 
 int join(commandline_t *comline);
-int get_ccs_join_info(commandline_t *comline);
 char *cman_error(int err);
 
 #endif  /*  __CMAN_TOOL_DOT_H__  */
cman/cman_tool/join.c +2 -12
index 7cd9016..0774c24 100644
@@ -17,7 +17,6 @@
 #include <netinet/in.h>
 #include "libcman.h"
 #include "cman_tool.h"
-#include "ccs.h"
 
 static char *argv[128];
 static char *envp[128];
@@ -60,17 +59,8 @@ int join(commandline_t *comline)
 	cman_handle_t h;
 	int status;
 	pid_t aisexec_pid;
-	int ctree;
 	int p[2];
 
-	if (!comline->noccs_opt) {
-		ctree = ccs_force_connect(NULL, 1);
-		if (ctree < 0) {
-			die("ccsd is not running\n");
-		}
-		ccs_disconnect(ctree);
-	}
-
         /*
 	 * If we can talk to cman then we're already joined (or joining);
 	 */
@@ -119,8 +109,8 @@ int join(commandline_t *comline)
 		snprintf(scratch, sizeof(scratch), "CMAN_DEBUGLOG=%d", comline->verbose);
 		envp[envptr++] = strdup(scratch);
 	}
-	if (comline->noccs_opt) {
-		envp[envptr++] = strdup("CMAN_NOCCS=true");
+	if (comline->noconfig_opt) {
+		envp[envptr++] = strdup("CMAN_NOCONFIG=true");
 		envp[envptr++] = strdup("OPENAIS_DEFAULT_CONFIG_IFACE=cmanpreconfig");
 	}
 	else {
cman/cman_tool/main.c +5 -4
index 4ac0616..f79897d 100644
@@ -52,8 +52,9 @@ static void print_usage(int subcmd)
 
 	if (!subcmd || subcmd == OP_JOIN) {
 		printf("join\n");
-		printf("  Cluster & node information is taken from CCS. These switches are provided to \n");
-		printf("  to allow CCS values to be overridden. Use them with extreme care.\n\n");
+		printf("  Cluster & node information is taken from configuration modules.\n");
+		printf("  These switches are provided to allow those values to be overridden.\n");
+		printf("  Use them with extreme care.\n\n");
 
 		printf("  -m <addr>        Multicast address to use\n");
 		printf("  -v <votes>       Number of votes this node has\n");
@@ -68,7 +69,7 @@ static void print_usage(int subcmd)
 		printf("  -t               Maximum time (in seconds) to wait\n");
 		printf("  -k <file>        Private key file for AIS communications\n");
 		printf("  -P               Don't set aisexec to realtime priority\n");
-		printf("  -X               Don't use CCS for configuration\n");
+		printf("  -X               Use internal cman defaults for configuration\n");
 		printf("\n");
 	}
 
@@ -870,7 +871,7 @@ static void decode_arguments(int argc, char *argv[], commandline_t *comline)
 			break;
 
 		case 'X':
-			comline->noccs_opt = TRUE;
+			comline->noconfig_opt = TRUE;
 			break;
 
 		case 'P':
cman/daemon/cman-preconfig.c +1 -1
index 5810f5a..f549019 100644
@@ -905,7 +905,7 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin
         }
 
 	get_env_overrides();
-	if (getenv("CMAN_NOCCS"))
+	if (getenv("CMAN_NOCONFIG"))
 		ret = set_noccs_defaults(objdb);
 	else
 		ret = get_cman_globals(objdb);
configure +4 -4
index c1dba32..caf7d35 100755
@@ -219,8 +219,8 @@ if ($help || !$err) {
   print "--kernel_build=\tthe directory containing the kernel object tree you wish to\n\t\tcompile against. (Default: /lib/modules/`uname -r`/build\n\t\tif available or /usr/src/linux as fallback)\n";
   print "--kernel_src=\tthe directory containing the kernel source you wish to\n\t\tcompile against.  (Default: /lib/modules/`uname -r`/source\n\t\tif available or \$kernel_build as fallback)\n";
   print "--incdir=\tthe base directory for include files.  (Default: {prefix}/include)\n";
-  print "--ccsincdir=\tthe base directory for ccs include files.  (Default: ./ccs/lib)\n";
-  print "--ccslibdir=\tthe base directory for ccs libraries.  (Default: ./ccs/lib)\n";
+  print "--ccsincdir=\tthe base directory for ccs include files.  (Default: ./ccs/libccsconfdb)\n";
+  print "--ccslibdir=\tthe base directory for ccs libraries.  (Default: ./ccs/libccsconfdb)\n";
   print "--cmanincdir=\tthe base directory for cman include files.  (Default: ./cman/lib)\n";
   print "--cmanlibdir=\tthe base directory for cman libraries.  (Default: ./cman/lib)\n";
   print "--dlmincdir=\tthe base directory for dlm include files.  (Default: ./dlm/libdlm)\n";
@@ -416,10 +416,10 @@ if (!$libdir) {
   $libdir="${prefix}/lib";
 }
 if (!$ccsincdir) {
-  $ccsincdir="${cdir}/ccs/lib";
+  $ccsincdir="${cdir}/ccs/libccsconfdb";
 }
 if (!$ccslibdir) {
-  $ccslibdir="${objdir}/ccs/lib";
+  $ccslibdir="${objdir}/ccs/libccsconfdb";
 }
 if (!$cmanincdir) {
   $cmanincdir="${cdir}/cman/lib";

hooks/post-receive
--
Cluster Project