rpms/openais/devel openais-trunk.diff, NONE, 1.1 openais.spec, 1.33, 1.34 openais-trunk-1682.diff, 1.1, NONE

Fabio M. Di Nitto fabbione at fedoraproject.org
Mon Feb 2 11:26:14 UTC 2009


Author: fabbione

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

Modified Files:
	openais.spec 
Added Files:
	openais-trunk.diff 
Removed Files:
	openais-trunk-1682.diff 
Log Message:
Update to latest trunk (1688).


openais-trunk.diff:

--- NEW FILE openais-trunk.diff ---
diff -Naurd openais-0.91/include/mar_clm.h openais-trunk/include/mar_clm.h
--- openais-0.91/include/mar_clm.h	2008-08-14 17:00:36.000000000 +0200
+++ openais-trunk/include/mar_clm.h	2008-11-25 18:39:02.000000000 +0100
@@ -39,6 +39,7 @@
 #include <corosync/swab.h>
 #include "saAis.h"
 #include "saClm.h"
+#include "mar_sa.h"
 #include <corosync/mar_gen.h>
 
 #define MAR_CLM_MAX_ADDRESS_LENGTH 64
@@ -110,7 +111,7 @@
 	dest->node_id = src->nodeId;
 	marshall_to_mar_clm_node_address_t (&dest->node_address,
 		&src->nodeAddress);
-	marshall_to_mar_name_t (&dest->node_name, &src->nodeName);
+	marshall_SaNameT_to_mar_name_t (&dest->node_name, &src->nodeName);
 	dest->member = src->member;
 	dest->boot_timestamp = src->bootTimestamp;
 	dest->initial_view_number = src->initialViewNumber;
@@ -123,7 +124,7 @@
 	dest->nodeId = src->node_id;
 	marshall_from_mar_clm_node_address_t (&dest->nodeAddress,
 		&src->node_address);
-	marshall_from_mar_name_t (&dest->nodeName, &src->node_name);
+	marshall_mar_name_t_to_SaNameT (&dest->nodeName, &src->node_name);
 	dest->member = src->member;
 	dest->bootTimestamp = src->boot_timestamp;
 	dest->initialViewNumber = src->initial_view_number;
diff -Naurd openais-0.91/include/mar_sa.h openais-trunk/include/mar_sa.h
--- openais-0.91/include/mar_sa.h	1970-01-01 01:00:00.000000000 +0100
+++ openais-trunk/include/mar_sa.h	2008-12-07 18:43:30.000000000 +0100
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2008, Allied Telesis Labs, New Zealand
+ *
+ * All rights reserved.
+ *
+ * Author: Angus Salkeld (ahsalkeld at gmail.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.
+ */
+
+#ifndef AIS_MAR_SA_H_DEFINED
+#define AIS_MAR_SA_H_DEFINED
+
+static inline void marshall_SaNameT_to_mar_name_t (
+	mar_name_t *dest,
+	const SaNameT *src)
+{
+	dest->length = src->length;
+	memcpy (dest->value, src->value, SA_MAX_NAME_LENGTH);
+}
+
+static inline void marshall_mar_name_t_to_SaNameT (
+	SaNameT *dest,
+	const mar_name_t *src)
+{
+	dest->length = src->length;
+	memcpy (dest->value, src->value, SA_MAX_NAME_LENGTH);
+}
+
+#endif /* AIS_MAR_SA_H_DEFINED */
+
diff -Naurd openais-0.91/lib/amf.c openais-trunk/lib/amf.c
--- openais-0.91/lib/amf.c	2008-09-17 21:18:35.000000000 +0200
+++ openais-trunk/lib/amf.c	2008-11-25 18:39:02.000000000 +0100
@@ -49,7 +49,7 @@
 #include <saAmf.h>
 #include <corosync/ipc_gen.h>
 #include <ipc_amf.h>
-#include <corosync/ais_util.h>
+#include "util.h"
 
 
 struct res_overlay {
diff -Naurd openais-0.91/lib/ckpt.c openais-trunk/lib/ckpt.c
--- openais-0.91/lib/ckpt.c	2008-07-24 15:20:09.000000000 +0200
+++ openais-trunk/lib/ckpt.c	2009-01-06 04:58:18.000000000 +0100
@@ -53,8 +53,9 @@
 #include "../include/saCkpt.h"
 #include "../include/ipc_ckpt.h"
 #include "../include/mar_ckpt.h"
+#include "../include/mar_sa.h"
 
-#include <corosync/ais_util.h>
+#include "util.h"
 
 struct message_overlay {
 	mar_res_header_t header __attribute__((aligned(8)));
@@ -634,7 +635,7 @@
 
 	req_lib_ckpt_checkpointopen.header.size = sizeof (struct req_lib_ckpt_checkpointopen);
 	req_lib_ckpt_checkpointopen.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN;
-	marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
 		(SaNameT *)checkpointName);
 	memcpy (&ckptCheckpointInstance->checkpointName, checkpointName, sizeof (SaNameT));
 	req_lib_ckpt_checkpointopen.async_call = 0;
@@ -759,7 +760,7 @@
 	if (failWithError == SA_AIS_OK) {
 		memcpy (&ckptCheckpointInstance->checkpointName, checkpointName,
 			sizeof (SaNameT));
-		marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
+		marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
 			(SaNameT *)checkpointName);
 	}
 
@@ -800,7 +801,7 @@
 
 	saHandleInstancePut (&ckptHandleDatabase, ckptHandle);
 
-	return (error == SA_AIS_OK ? res_lib_ckpt_checkpointopenasync.header.error : error);
+	return (SA_AIS_OK);
 
 error_put_destroy:
 	saHandleInstancePut (&checkpointHandleDatabase, checkpointHandle);
@@ -829,7 +830,7 @@
 
 	req_lib_ckpt_checkpointclose.header.size = sizeof (struct req_lib_ckpt_checkpointclose);
 	req_lib_ckpt_checkpointclose.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTCLOSE;
-	marshall_to_mar_name_t (&req_lib_ckpt_checkpointclose.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointclose.checkpoint_name,
 		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_checkpointclose.ckpt_id =
 		ckptCheckpointInstance->checkpointId;
@@ -877,7 +878,7 @@
 
 	req_lib_ckpt_checkpointunlink.header.size = sizeof (struct req_lib_ckpt_checkpointunlink);
 	req_lib_ckpt_checkpointunlink.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTUNLINK;
-	marshall_to_mar_name_t (&req_lib_ckpt_checkpointunlink.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointunlink.checkpoint_name,
 		(SaNameT *)checkpointName);
 
 	pthread_mutex_lock (&ckptInstance->response_mutex);
@@ -916,7 +917,7 @@
 	req_lib_ckpt_checkpointretentiondurationset.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET;
 
 	req_lib_ckpt_checkpointretentiondurationset.retention_duration = retentionDuration;
-	marshall_to_mar_name_t (&req_lib_ckpt_checkpointretentiondurationset.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointretentiondurationset.checkpoint_name,
 		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_checkpointretentiondurationset.ckpt_id =
 		ckptCheckpointInstance->checkpointId;
@@ -957,7 +958,7 @@
 
 	req_lib_ckpt_activereplicaset.header.size = sizeof (struct req_lib_ckpt_activereplicaset);
 	req_lib_ckpt_activereplicaset.header.id = MESSAGE_REQ_CKPT_ACTIVEREPLICASET;
-	marshall_to_mar_name_t (&req_lib_ckpt_activereplicaset.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_activereplicaset.checkpoint_name,
 		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_activereplicaset.ckpt_id =
 		ckptCheckpointInstance->checkpointId;
@@ -1000,7 +1001,7 @@
 	req_lib_ckpt_checkpointstatusget.header.size = sizeof (struct req_lib_ckpt_checkpointstatusget);
 	req_lib_ckpt_checkpointstatusget.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET;
 
-	marshall_to_mar_name_t (&req_lib_ckpt_checkpointstatusget.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointstatusget.checkpoint_name,
 		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_checkpointstatusget.ckpt_id =
 		ckptCheckpointInstance->checkpointId;
@@ -1065,7 +1066,7 @@
 	req_lib_ckpt_sectioncreate.expiration_time = sectionCreationAttributes->expirationTime;
 	req_lib_ckpt_sectioncreate.initial_data_size = initialDataSize;
 
-	marshall_to_mar_name_t (&req_lib_ckpt_sectioncreate.checkpoint_name,
+	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectioncreate.checkpoint_name,
 		&ckptCheckpointInstance->checkpointName);
 	req_lib_ckpt_sectioncreate.ckpt_id =
 		ckptCheckpointInstance->checkpointId;
@@ -1137,7 +1138,7 @@
 	req_lib_ckpt_sectiondelete.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONDELETE;
 	req_lib_ckpt_sectiondelete.id_len = sectionId->idLen;
 
[...4377 lines suppressed...]
+ *   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 <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/select.h>
+#include <sys/un.h>
+
+#include "saAis.h"
+#include "saLck.h"
+
+void testLckResourceOpenCallback (
+	SaInvocationT invocation,
+	SaLckResourceHandleT lockResourceHandle,
+	SaAisErrorT error)
+{
+	printf ("testLckResourceOpenCallback\n");
+}
+
+void testLckLockGrantCallback (
+	SaInvocationT invocation,
+	SaLckLockStatusT lockStatus,
+	SaAisErrorT error)
+{
+	printf ("testLckLockGrantCallback\n");
+}
+
+void testLckLockWaiterCallback (
+	SaLckWaiterSignalT waiterSignal,
+        SaLckLockIdT lockId,
+        SaLckLockModeT modeHeld,
+        SaLckLockModeT modeRequested)
+{
+	printf ("testLckLockWaiterCallback\n");
+}
+
+void testLckResourceUnlockCallback (
+	SaInvocationT invocation,
+        SaAisErrorT error)
+{
+	printf ("testLckResourceUnlockCallback\n");
+}
+
+SaLckCallbacksT callbacks = {
+	.saLckResourceOpenCallback	= testLckResourceOpenCallback,
+	.saLckLockGrantCallback		= testLckLockGrantCallback,
+	.saLckLockWaiterCallback	= testLckLockWaiterCallback,
+	.saLckResourceUnlockCallback	= testLckResourceUnlockCallback
+};
+
+SaVersionT version = { 'B', 1, 1 };
+
+void setSaNameT (SaNameT *name, char *str) {
+	strncpy ((char *)name->value, str, SA_MAX_NAME_LENGTH);
+	if (strlen ((char *)name->value) > SA_MAX_NAME_LENGTH) {
+		name->length = SA_MAX_NAME_LENGTH;
+	} else {
+		name->length = strlen (str);
+	}
+}
+
+void sigintr_handler (int signum) {
+	exit (0);
+}
+
+int main (void)
+{
+	int result;
+
+	SaLckHandleT handle;
+	SaLckLockIdT lock_id;
+	SaLckLockStatusT status;
+
+	SaLckResourceHandleT resource_handle_a;
+	SaLckResourceHandleT resource_handle_b;
+	SaLckResourceHandleT resource_handle_c;
+
+	SaNameT resource_name_a;
+	SaNameT resource_name_b;
+	SaNameT resource_name_c;
+
+	result = saLckInitialize (&handle, &callbacks, &version);
+
+	if (result != SA_AIS_OK) {
+		printf ("[ERROR]: (%d) saLckInitialize\n", result);
+		exit (1);
+	}
+
+	setSaNameT (&resource_name_a, "test_resource_a");
+	setSaNameT (&resource_name_b, "test_resource_b");
+	setSaNameT (&resource_name_c, "test_resource_c");
+
+	/*
+	 * Open resources
+	 */
+	result = saLckResourceOpen (handle, &resource_name_a,
+				    SA_LCK_RESOURCE_CREATE, SA_TIME_ONE_SECOND,
+				    &resource_handle_a);
+	printf ("[DEBUG]: (%d) saLckResourceOpen { %s }\n",
+		result, (char *)(resource_name_a.value));
+
+	result = saLckResourceOpen (handle, &resource_name_b,
+				    SA_LCK_RESOURCE_CREATE, SA_TIME_ONE_SECOND,
+				    &resource_handle_b);
+	printf ("[DEBUG]: (%d) saLckResourceOpen { %s }\n",
+		result, (char *)(resource_name_b.value));
+
+	result = saLckResourceOpen (handle, &resource_name_c,
+				    SA_LCK_RESOURCE_CREATE, SA_TIME_ONE_SECOND,
+				    &resource_handle_c);
+	printf ("[DEBUG]: (%d) saLckResourceOpen { %s }\n",
+		result, (char *)(resource_name_c.value));
+
+	/*
+	 * Add resource locks to resource "A"
+	 */
+	result = saLckResourceLock (resource_handle_a, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_a.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_a, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_a.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_a, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_a.value), lock_id, status);
+
+	/*
+	 * Add resource locks to resource "B"
+	 */
+	result = saLckResourceLock (resource_handle_b, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_b.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_b, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_b.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_b, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_b.value), lock_id, status);
+
+	/*
+	 * Add resource locks to resource "C"
+	 */
+	result = saLckResourceLock (resource_handle_c, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_c.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_c, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_c.value), lock_id, status);
+
+	result = saLckResourceLock (resource_handle_c, &lock_id,
+				   SA_LCK_PR_LOCK_MODE, SA_LCK_LOCK_ORPHAN,
+				   55, SA_TIME_END, &status);
+	printf ("[DEBUG]: (%d) saLckResourceLock { %s } [ id=%x status=%d ]\n",
+		result, (char *)(resource_name_c.value), lock_id, status);
+
+	sleep (30);
+
+	return (0);
+}


Index: openais.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openais/devel/openais.spec,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- openais.spec	27 Jan 2009 10:46:02 -0000	1.33
+++ openais.spec	2 Feb 2009 11:25:43 -0000	1.34
@@ -1,20 +1,20 @@
-%define alphatag svn1682
+%define alphatag svn1688
 
 Name: openais
 Summary: The openais Standards-Based Cluster Framework executive and APIs
 Version: 0.91
-Release: 5%{?alphatag:.%{alphatag}}%{?dist}
+Release: 6%{?alphatag:.%{alphatag}}%{?dist}
 License: BSD
 Group: System Environment/Base
 URL: http://developer.osdl.org/dev/openais/
 Source0: http://www.osdl.org/downloads/openais-%{version}/openais-%{version}.tar.gz
-Patch0: openais-trunk-1682.diff
+Patch0: openais-trunk.diff
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
-Requires: corosync >= 0.92-6
-BuildRequires: corosync-devel >= 0.92-6
+Requires: corosync >= 0.92-7
+BuildRequires: corosynclib-devel >= 0.92-7
 Conflicts: openais-devel <= 0.89
 
 %description 
@@ -114,8 +114,14 @@
 %{_libdir}/openais/libSaEvt.so
 %{_libdir}/openais/libSaLck.so
 %{_libdir}/openais/libSaMsg.so
+%{_libdir}/pkgconfig/*.pc
 
 %changelog
+* Mon Feb  2 2009 Fabio M. Di Nitto <fdinitto at redhat.com> - 0.91-6.svn1688
+- Update to svn trunk at revision 1688 from upstream.
+- Add support pkgconfig to devel package.
+- Update BuildRequires: on corosynclib-devel.
+
 * Tue Jan 27 2009 Fabio M. Di Nitto <fdinitto at redhat.com> - 0.91-5.svn1682
 - Update to svn trunk at revision 1682 from upstream.
 


--- openais-trunk-1682.diff DELETED ---




More information about the scm-commits mailing list