rpms/corosync/devel corosync-trunk.diff, NONE, 1.1 corosync.spec, 1.6, 1.7 corosync-trunk-1750.diff, 1.1, NONE

Fabio M. Di Nitto fabbione at fedoraproject.org
Mon Feb 2 07:19:36 UTC 2009


Author: fabbione

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

Modified Files:
	corosync.spec 
Added Files:
	corosync-trunk.diff 
Removed Files:
	corosync-trunk-1750.diff 
Log Message:
Update to latest trunk (1756)


corosync-trunk.diff:

--- NEW FILE corosync-trunk.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/coropoll.c corosync-trunk/exec/coropoll.c
--- corosync-0.92/exec/coropoll.c	2008-08-14 18:44:26.000000000 +0200
+++ corosync-trunk/exec/coropoll.c	2009-01-20 18:59:10.000000000 +0100
@@ -59,6 +59,7 @@
 	struct timerlist timerlist;
 	void (*serialize_lock_fn) (void);
 	void (*serialize_unlock_fn) (void);
+	int stop_requested;
 };
 
 /*
@@ -92,6 +93,7 @@
 	poll_instance->poll_entries = 0;
 	poll_instance->ufds = 0;
 	poll_instance->poll_entry_count = 0;
+	poll_instance->stop_requested = 0;
 	poll_instance->serialize_lock_fn = serialize_lock_fn;
 	poll_instance->serialize_unlock_fn = serialize_unlock_fn;
 	timerlist_init (&poll_instance->timerlist);
@@ -291,18 +293,18 @@
 	struct poll_instance *poll_instance;
 	int res = 0;
 
+	if (timer_handle_out == NULL) {
+		res -ENOENT;
+		goto error_exit;
+	}
+
 	res = hdb_handle_get (&poll_instance_database, handle,
 		(void *)&poll_instance);
 	if (res != 0) {
 		res = -ENOENT;
-		
 		goto error_exit;
 	}
 
-	if (timer_handle_out == 0) {
-		res = -ENOENT;
-	}
-
 	timerlist_add_duration (&poll_instance->timerlist,
 		timer_fn, data, ((unsigned long long)msec_duration) * 1000000ULL, timer_handle_out);
 
@@ -336,6 +338,27 @@
 	return (res);
 }
 
+int poll_stop (
+	poll_handle handle)
+{
+	struct poll_instance *poll_instance;
+	unsigned int res;
+
+	res = hdb_handle_get (&poll_instance_database, handle,
+		(void *)&poll_instance);
+	if (res != 0) {
+		res = -ENOENT;
+		goto error_exit;
+	}
+	
+	poll_instance->stop_requested = 1;
+
+	hdb_handle_put (&poll_instance_database, handle);
+error_exit:
+	return (res);
+}
+
+
 int poll_run (
 	poll_handle handle)
 {
@@ -366,6 +389,10 @@
 retry_poll:
 		res = poll (poll_instance->ufds,
 			poll_instance->poll_entry_count, expire_timeout_msec);
+		if (poll_instance->stop_requested) {
+			printf ("poll should stop\n");
+			return (0);
+		}
 		if (errno == EINTR && res == -1) {
 			goto retry_poll;
 		} else
@@ -403,9 +430,6 @@
 	return (-1);
 }
 
-int poll_stop (
-	poll_handle handle);
-
 #ifdef COMPILE_OUT
 void poll_print_state (
 	poll_handle handle,
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	2009-01-26 21:22:28.000000000 +0100
@@ -20,13 +20,14 @@
 #endif
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdint.h>
 
 #include "crypto.h"
 
 #define CONST64(n) n ## ULL
 
-typedef unsigned long ulong32;
-typedef unsigned long long ulong64;
+typedef uint32_t ulong32;
+typedef uint64_t ulong64;
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define ENDIAN_LITTLE
@@ -41,10 +42,10 @@
 #endif
 
 #if defined(COROSYNC_LINUX)
[...22307 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- corosync.spec	27 Jan 2009 10:44:56 -0000	1.6
+++ corosync.spec	2 Feb 2009 07:19:05 -0000	1.7
@@ -1,14 +1,14 @@
-%define alphatag svn1750
+%define alphatag svn1756
 
 Name: corosync
 Summary: The Corosync Cluster Engine and Application Programming Interfaces
 Version: 0.92
-Release: 6%{?alphatag:.%{alphatag}}%{?dist}
+Release: 7%{?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-1750.diff
+Patch0: corosync-trunk.diff
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(pre): /usr/sbin/useradd
@@ -26,6 +26,7 @@
 Summary: The Corosync Cluster Engine
 Group: System Environment/Libraries
 Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig
 
 %description devel
 This package contains include files and man pages used to develop using
@@ -154,6 +155,7 @@
 %{_libdir}/corosync/libcoroutil.so
 %{_libdir}/corosync/libquorum.so
 %{_libdir}/corosync/libvotequorum.so
+%{_libdir}/pkgconfig/*.pc
 %{_mandir}/man3/cpg_*3*
 %{_mandir}/man3/evs_*3*
 %{_mandir}/man3/confdb_*3*
@@ -165,6 +167,10 @@
 %{_mandir}/man8/votequorum_overview.8*
 
 %changelog
+* Mon Feb  2 2009 Fabio M. Di Nitto <fdinitto at redhat.com> - 0.92-7.svn1756
+- Update to svn trunk at revision 1756 from upstream.
+- Add support pkgconfig to devel package.
+
 * Tue Jan 27 2009 Fabio M. Di Nitto <fdinitto at redhat.com> - 0.92-6.svn1750
 - Update to svn trunk at revision 1750 from upstream.
 - Include new quorum service in the packaging.


--- corosync-trunk-1750.diff DELETED ---




More information about the scm-commits mailing list