rpms/corosync/devel corosync-trunk-1707.diff, NONE, 1.1 corosync.spec, 1.3, 1.4

Fabio M. Di Nitto fabbione at fedoraproject.org
Wed Dec 10 07:43:23 UTC 2008


Author: fabbione

Update of /cvs/pkgs/rpms/corosync/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11424

Modified Files:
	corosync.spec 
Added Files:
	corosync-trunk-1707.diff 
Log Message:
Update to svn trunk at revision 1707


corosync-trunk-1707.diff:

--- NEW FILE corosync-trunk-1707.diff ---
diff -Naurd corosync-0.92/exec/apidef.c corosync-trunk/exec/apidef.c
--- corosync-0.92/exec/apidef.c	2008-09-17 21:15:00.000000000 +0200
+++ corosync-trunk/exec/apidef.c	2008-12-08 16:55:41.000000000 +0100
@@ -46,6 +46,7 @@
 #include "main.h"
 #include "ipc.h"
 #include "sync.h"
+#include "quorum.h"
 #include <corosync/engine/coroapi.h>
 #include "service.h"
 #include <corosync/lcr/lcr_ifact.h>
@@ -55,11 +56,16 @@
 /*
  * Remove compile warnings about type name changes
  */
-typedef int (*typedef_tpg_join) (corosync_tpg_handle, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_leave) (corosync_tpg_handle, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_groups_mcast) (corosync_tpg_handle, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
-typedef int (*typedef_tpg_groups_send_ok) (corosync_tpg_handle, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_join) (cs_tpg_handle, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_leave) (cs_tpg_handle, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_groups_mcast) (cs_tpg_handle, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_groups_send_ok) (cs_tpg_handle, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
 
+static inline void _corosync_public_exit_error (
+	cs_fatal_error_t err, const char *file, unsigned int line)
+{
+	_corosync_exit_error (err, file, line);
+}
 
 static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.timer_add_duration = corosync_timer_add_duration,
@@ -68,16 +74,16 @@
 	.timer_time_get = NULL,
 	.ipc_source_set = message_source_set,
 	.ipc_source_is_local = message_source_is_local,
-	.ipc_private_data_get = corosync_conn_private_data_get,
+	.ipc_private_data_get = cs_conn_private_data_get,
 	.ipc_response_send = NULL,
-	.ipc_response_no_fcc = corosync_conn_send_response_no_fcc,
+	.ipc_response_no_fcc = cs_conn_send_response_no_fcc,
 	.ipc_dispatch_send = NULL,
-	.ipc_conn_send_response = corosync_conn_send_response,
-	.ipc_conn_partner_get = corosync_conn_partner_get,
-	.ipc_refcnt_inc =  corosync_ipc_flow_control_local_increment,
-	.ipc_refcnt_dec = corosync_ipc_flow_control_local_decrement,
-	.ipc_fc_create = corosync_ipc_flow_control_create,
-	.ipc_fc_destroy = corosync_ipc_flow_control_destroy,
+	.ipc_conn_send_response = cs_conn_send_response,
+	.ipc_conn_partner_get = cs_conn_partner_get,
+	.ipc_refcnt_inc =  cs_ipc_flow_control_local_increment,
+	.ipc_refcnt_dec = cs_ipc_flow_control_local_decrement,
+	.ipc_fc_create = cs_ipc_flow_control_create,
+	.ipc_fc_destroy = cs_ipc_flow_control_destroy,
 	.totem_nodeid_get = totempg_my_nodeid_get,
 	.totem_family_get = totempg_my_family_get,
 	.totem_ring_reenable = totempg_ring_reenable,
@@ -86,6 +92,7 @@
 	.totem_ifaces_get = totempg_ifaces_get,
 	.totem_ifaces_print = totempg_ifaces_print,
 	.totem_ip_print = totemip_print,
+	.totem_callback_token_create = totempg_callback_token_create,
 	.tpg_init = totempg_groups_initialize,
 	.tpg_exit = NULL, /* missing from totempg api */
 	.tpg_join = (typedef_tpg_join)totempg_groups_join,
@@ -95,12 +102,16 @@
 	.tpg_groups_mcast = (typedef_tpg_groups_mcast)totempg_groups_mcast_groups,
 	.tpg_groups_send_ok = (typedef_tpg_groups_send_ok)totempg_groups_send_ok_groups,
 	.sync_request = sync_request,
+	.quorum_is_quorate = corosync_quorum_is_quorate,
+	.quorum_register_callback = corosync_quorum_register_callback,
+	.quorum_unregister_callback = corosync_quorum_unregister_callback,
+	.quorum_initialize = corosync_quorum_initialize,
 	.service_link_and_init = corosync_service_link_and_init,
 	.service_unlink_and_exit = corosync_service_unlink_and_exit,
 	.plugin_interface_reference = lcr_ifact_reference,
 	.plugin_interface_release = lcr_ifact_release,
 	.error_memory_failure = _corosync_out_of_memory_error,
-	.fatal_error = _corosync_exit_error
+	.fatal_error = _corosync_public_exit_error
 };
 
 void apidef_init (struct objdb_iface_ver0 *objdb) {
diff -Naurd corosync-0.92/exec/crypto.c corosync-trunk/exec/crypto.c
--- corosync-0.92/exec/crypto.c	2008-08-15 08:15:26.000000000 +0200
+++ corosync-trunk/exec/crypto.c	2008-11-11 19:13:47.000000000 +0100
@@ -844,7 +844,7 @@
        assert ((len & 3) == 0);
     
        for (i = 0; i < len; i += 4) {
-           k = BYTE2WORD((unsigned char *)&buf[i]);
+           k = BYTE2WORD((unsigned char*)&buf[i]);
           ADDKEY(k);
           cycle(c->R);
           XORNL(nltap(c));
@@ -1250,11 +1250,11 @@
                              void (*callback)(void))
 {
 	int fd;
-	int rb;
+	unsigned long rb;
 
 	fd = open ("/dev/urandom", O_RDONLY);
 	
-	rb = read (fd, buf, len);
+	rb = (unsigned long)read (fd, buf, len);
 
 	close (fd);
 
diff -Naurd corosync-0.92/exec/flow.c corosync-trunk/exec/flow.c
--- corosync-0.92/exec/flow.c	2008-08-14 18:54:46.000000000 +0200
+++ corosync-trunk/exec/flow.c	2008-11-06 22:49:07.000000000 +0100
@@ -34,9 +34,9 @@
 
 /*
  * New messages are allowed from the library ONLY when the processor has not
- * received a COROSYNC_FLOW_CONTROL_STATE_ENABLED from any processor.  If a
- * COROSYNC_FLOW_CONTROL_STATE_ENABLED message is sent, it must later be
- *  cancelled by a COROSYNC_FLOW_CONTROL_STATE_DISABLED message.  A configuration
+ * received a CS_FLOW_CONTROL_STATE_ENABLED from any processor.  If a
+ * CS_FLOW_CONTROL_STATE_ENABLED message is sent, it must later be
+ *  cancelled by a CS_FLOW_CONTROL_STATE_DISABLED message.  A configuration
  * change with the flow controlled processor leaving the configuration will
  * also cancel flow control.
  */
@@ -68,12 +68,12 @@
 	unsigned int service __attribute__((aligned(8)));
 	char id[1024] __attribute__((aligned(8)));
 	unsigned int id_len __attribute__((aligned(8)));
-	enum corosync_flow_control_state flow_control_state __attribute__((aligned(8)));
+	enum cs_flow_control_state flow_control_state __attribute__((aligned(8)));
 };
 
 struct flow_control_node_state {
 	unsigned int nodeid;
-	enum corosync_flow_control_state flow_control_state;
+	enum cs_flow_control_state flow_control_state;
 };
 
 struct flow_control_service {
@@ -81,10 +81,10 @@
 	unsigned int service;
 	char id[1024];
 	unsigned int id_len;
-	void (*flow_control_state_set_fn) (void *context, enum corosync_flow_control_state flow_control_state);
+	void (*flow_control_state_set_fn) (void *context, enum cs_flow_control_state flow_control_state);
 	void *context;
 	unsigned int processor_count;
-	enum corosync_flow_control_state flow_control_state;
+	enum cs_flow_control_state flow_control_state;
 	struct list_head list;
 	struct list_head list_all;
 };
@@ -108,7 +108,7 @@
 
 static inline int flow_control_xmit (
 	struct flow_control_service *flow_control_service,
-	enum corosync_flow_control_state flow_control_state)
+	enum cs_flow_control_state flow_control_state)
 {
 	struct flow_control_message flow_control_message;
 	struct iovec iovec;
@@ -165,11 +165,11 @@
 		 * Determine if any flow control is enabled on any nodes and set
 		 * the internal variable appropriately
 		 */
-		flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
+		flow_control_service->flow_control_state = CS_FLOW_CONTROL_STATE_DISABLED;
 		flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
 		for (i = 0; i < flow_control_service->processor_count; i++) {
-			if (flow_control_service->flow_control_node_state[i].flow_control_state == COROSYNC_FLOW_CONTROL_STATE_ENABLED) {
-				flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_ENABLED;
+			if (flow_control_service->flow_control_node_state[i].flow_control_state == CS_FLOW_CONTROL_STATE_ENABLED) {
+				flow_control_service->flow_control_state = CS_FLOW_CONTROL_STATE_ENABLED;
 				flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
 			}
 		}
@@ -204,7 +204,7 @@
 		 */
 		for (i = 0; i < member_list_entries; i++) {
 			flow_control_node_state_temp[i].nodeid = member_list[i];
-			flow_control_node_state_temp[i].flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
+			flow_control_node_state_temp[i].flow_control_state = CS_FLOW_CONTROL_STATE_DISABLED;
 
 			/*
 			 * Determine if previous state was set for this processor
@@ -231,10 +231,10 @@
 		 * Turn on all flow control after a configuration change
 		 */
 		flow_control_service->processor_count = flow_control_member_list_entries;
-		flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_DISABLED;
+		flow_control_service->flow_control_state = CS_FLOW_CONTROL_STATE_DISABLED;
 		for (i = 0; i < member_list_entries; i++) {
-			if (flow_control_service->flow_control_node_state[i].flow_control_state == COROSYNC_FLOW_CONTROL_STATE_ENABLED) {
-				flow_control_service->flow_control_state = COROSYNC_FLOW_CONTROL_STATE_ENABLED;
+			if (flow_control_service->flow_control_node_state[i].flow_control_state == CS_FLOW_CONTROL_STATE_ENABLED) {
+				flow_control_service->flow_control_state = CS_FLOW_CONTROL_STATE_ENABLED;
 				flow_control_service->flow_control_state_set_fn (flow_control_service->context, flow_control_service->flow_control_state);
 			}
[...16171 lines suppressed...]
-	if (res != CONFDB_OK) {
+	if (res != CS_OK) {
 		fprintf (stderr, "Could not enable tracking on object \"%s\". Error %d\n",
 				 name_pt, res);
 		return;
@@ -501,10 +507,10 @@
 
 static void stop_tracking(confdb_handle_t handle)
 {
-	confdb_error_t res;
+	cs_error_t res;
 
 	res = confdb_stop_track_changes (handle);
-	if (res != CONFDB_OK) {
+	if (res != CS_OK) {
 		fprintf (stderr, "Could not stop tracking. Error %d\n", res);
 		return;
 	}
@@ -512,14 +518,14 @@
 
 static void delete_object(confdb_handle_t handle, char * name_pt)
 {
-	confdb_error_t res;
+	cs_error_t res;
 	uint32_t obj_handle;
 	res = find_object (handle, name_pt, FIND_OBJECT_ONLY, &obj_handle);
 
-	if (res == CONFDB_OK) {
+	if (res == CS_OK) {
 		res = confdb_object_destroy (handle, obj_handle);
 
-		if (res != CONFDB_OK)
+		if (res != CS_OK)
 			fprintf(stderr, "Failed to find object \"%s\" to delete. Error %d\n", name_pt, res);
 	} else {
 		char parent_name[OBJ_NAME_SIZE];
@@ -531,7 +537,7 @@
 		get_key(name_pt, key_name, key_value);
 		res = find_object (handle, parent_name, FIND_OBJECT_ONLY, &obj_handle);
 
-		if (res != CONFDB_OK) {
+		if (res != CS_OK) {
 			fprintf(stderr, "Failed to find the key's parent object \"%s\". Error %d\n", parent_name, res);
 			exit (EXIT_FAILURE);
 		}
@@ -543,7 +549,7 @@
 								 key_value,
 								 strlen(key_value));
 
-		if (res != CONFDB_OK)
+		if (res != CS_OK)
 			fprintf(stderr, "Failed to delete key \"%s=%s\" from object \"%s\". Error %d\n",
 					key_name, key_value, parent_name, res);
 	}
@@ -552,8 +558,8 @@
 
 int main (int argc, char *argv[]) {
 	confdb_handle_t handle;
-	confdb_error_t result;
-	char c;
+	cs_error_t result;
+	int c;
 
 	action = ACTION_READ;
 
@@ -603,7 +609,7 @@
 	}
 
 	result = confdb_initialize (&handle, &callbacks);
-	if (result != CONFDB_OK) {
+	if (result != CS_OK) {
 		fprintf (stderr, "Failed to initialize the objdb API. Error %d\n", result);
 		exit (EXIT_FAILURE);
 	}
@@ -633,7 +639,7 @@
 	}
 
 	result = confdb_finalize (handle);
-	if (result != CONFDB_OK) {
+	if (result != CS_OK) {
 		fprintf (stderr, "Error finalizing objdb API. Error %d\n", result);
 		exit(EXIT_FAILURE);
 	}
diff -Naurd corosync-0.92/tools/corosync-pload.c corosync-trunk/tools/corosync-pload.c
--- corosync-0.92/tools/corosync-pload.c	1970-01-01 01:00:00.000000000 +0100
+++ corosync-trunk/tools/corosync-pload.c	2008-11-06 22:49:07.000000000 +0100
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2008 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake (sdake at redhat.com)
+ *
+ * This software licensed under BSD license, the text of which follows:
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ *   this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * - Neither the name of the MontaVista Software, Inc. nor the names of its
+ *   contributors may be used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <errno.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+#include <sys/un.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <corosync/corotypes.h>
+#include <corosync/pload.h>
+
+#define timersub(a, b, result)						\
+do {									\
+	(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;			\
+	(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;		\
+	if ((result)->tv_usec < 0) {					\
+		--(result)->tv_sec;					\
+		(result)->tv_usec += 1000000;				\
+	}								\
+} while (0)
+
+int main (void) {
+	pload_error_t result;
+	pload_handle_t handle;
+
+	result = pload_initialize (&handle, NULL);
+	printf ("Init result %d\n", result);
+	result = pload_start (
+		handle,
+		0, /* code */
+		150000000, /* count */
+		300); /* size */
+	return (0);
+}
diff -Naurd corosync-0.92/tools/Makefile corosync-trunk/tools/Makefile
--- corosync-0.92/tools/Makefile	2008-08-15 08:15:26.000000000 +0200
+++ corosync-trunk/tools/Makefile	2008-11-11 18:28:22.000000000 +0100
@@ -41,8 +41,8 @@
 	override LDFLAGS += -lnsl -lsocket -lrt
 endif
 
-LIBS = ../lib/libconfdb.a ../lib/libcfg.a
-BINARIES=corosync-objctl corosync-cfgtool corosync-keygen
+LIBS = ../lib/libconfdb.a ../lib/libcfg.a ../lib/libpload.a
+BINARIES=corosync-objctl corosync-cfgtool corosync-keygen corosync-fplay corosync-pload
 APPS_SRC=$(addsuffix .c,$(BINARIES))
 EXTRA_CFLAGS = -I$(srcdir)include
 
@@ -57,9 +57,22 @@
 corosync-keygen: corosync-keygen.o
 	$(CC) $(LDFLAGS) -o $@ $<
 
+corosync-fplay: corosync-fplay.o
+	$(CC) $(LDFLAGS) -o $@ $<
+
+corosync-pload: corosync-pload.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+
 clean:
 	rm -f *.o $(BINARIES)
 
+lint:
+	-splint $(LINT_FLAGS) $(CFLAGS) corosync-objctl.c
+	-splint $(LINT_FLAGS) $(CFLAGS) corosync-cfgtool.c
+	-splint $(LINT_FLAGS) $(CFLAGS) corosync-keygen.c
+	-splint $(LINT_FLAGS) $(CFLAGS) corosync-fplay.c
+	-splint $(LINT_FLAGS) $(CFLAGS) corosync-pload.c
+
 %.o: %.c
 	$(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 


Index: corosync.spec
===================================================================
RCS file: /cvs/pkgs/rpms/corosync/devel/corosync.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- corosync.spec	14 Oct 2008 04:06:08 -0000	1.3
+++ corosync.spec	10 Dec 2008 07:42:53 -0000	1.4
@@ -1,11 +1,14 @@
+%define alphatag svn1707
+
 Name: corosync
 Summary: The Corosync Cluster Engine and Application Programming Interfaces
 Version: 0.92
-Release: 3%{?alphatag:.%{alphatag}}%{?dist}
+Release: 4%{?alphatag:.%{alphatag}}%{?dist}
 License: BSD
 Group: System Environment/Base
 URL: http://www.openais.org
 Source0: http://developer.osdl.org/dev/openais/downloads/corosync-%{version}/corosync-%{version}.tar.gz
+Patch0: corosync-trunk-1707.diff
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(pre): /usr/sbin/useradd
@@ -30,6 +33,7 @@
 
 %prep
 %setup -q -n corosync-%{version}
+%patch0 -p1
 
 %build
 
@@ -89,6 +93,9 @@
 %{_libexecdir}/lcrso/service_cpg.lcrso
 %{_libexecdir}/lcrso/service_evs.lcrso
 %{_libexecdir}/lcrso/service_confdb.lcrso
+%{_libexecdir}/lcrso/service_pload.lcrso
+%{_libexecdir}/lcrso/testquorum.lcrso
+%{_libexecdir}/lcrso/vsf_quorum.lcrso
 %{_libexecdir}/lcrso/vsf_ykd.lcrso
 %dir %{_libdir}/corosync
 %{_libdir}/corosync/libcfg.so.*
@@ -107,10 +114,10 @@
 %dir %{_docdir}/%{name}-%{version}
 %doc %{_docdir}/%{name}-%{version}/README.devmap
 %dir %{_includedir}/corosync/
-%{_includedir}/corosync/saAis.h
 %{_includedir}/corosync/ais_util.h
 %{_includedir}/corosync/cfg.h
 %{_includedir}/corosync/confdb.h
+%{_includedir}/corosync/corotypes.h
 %{_includedir}/corosync/cpg.h
 %{_includedir}/corosync/evs.h
 %{_includedir}/corosync/hdb.h
@@ -148,6 +155,10 @@
 %{_mandir}/man8/logsys_overview.8*
 
 %changelog
+* Wed Dec 10 2008 Fabio M. Di Nitto <fdinitto at redhat.com> - 0.92-4.svn1707
+- Update to svn trunk at revision 1707 from upstream.
+- Update spec file to include new lcrso services and include file.
+
 * Mon Oct 13 2008 Dennis Gilmore <dennis at ausil.us> - 0.92-3
 - remove ExclusiveArch line
 




More information about the fedora-extras-commits mailing list