--- openais-0.91.orig/debian/openais.logrotate +++ openais-0.91/debian/openais.logrotate @@ -0,0 +1,10 @@ +/var/log/openais/*.log { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 root adm + sharedscripts +} --- openais-0.91.orig/debian/openais.default +++ openais-0.91/debian/openais.default @@ -0,0 +1,2 @@ +# start openais at boot [yes|no] +START=no --- openais-0.91.orig/debian/copyright +++ openais-0.91/debian/copyright @@ -0,0 +1,81 @@ +This is the Ubuntu / Debian GNU/Linux prepackaged version of OpenAIS. + +Mainly packaged by Fabio M. Di Nitto . + +Upstream: http://svn.fedorahosted.org/svn/openais + +Copyright (c) 2005-2008 Red Hat, Inc. + +*** +All cryptographic software in this package is subject to the following legal +notice: +This package includes publicly available encryption source code which, +together with object code resulting from the compiling of publicly +available source code, may be exported from the United States under License +Exception TSU prsuant to 15 C.F.R Section 740.13(e). +*** +----------------------------------------------------------------------------- +The following license applies to every file in this package except for +the files exec/crypto.c and exec/crypto.h. The license for these files is +described later in this document. Some files are contributed by other authors +and hence not copyright MontaVista Software. In this case, the license is +still as follows: +----------------------------------------------------------------------------- + +Copyright (c) 2002-2004 MontaVista Software, Inc. + +All rights reserved. + +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. +----------------------------------------------------------------------------- +The openais project uses software from the LibTomCrypt project +www.libtomcrypt.org. This software is contained the files exec/crypto.c and +exec/crypto.h. The following license applies to the files exec/crypto.c and +exec/crytpo.h: +----------------------------------------------------------------------------- +LibTomCrypt is public domain. As should all quality software be. + +All of the software was either written by or donated to Tom St Denis for the +purposes of this project. The only exception is the SAFER.C source which has +no known license status (assumed copyrighted) which is why SAFER,C is shipped +as disabled. + +Tom St Denis + +LICENCE from exec/crypto.c and .h: + +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org + */ + --- openais-0.91.orig/debian/changelog +++ openais-0.91/debian/changelog @@ -0,0 +1,428 @@ +openais (0.91-0ubuntu3) jaunty; urgency=low + + * Svn up to 1682. + + -- Fabio M. Di Nitto Tue, 27 Jan 2009 07:28:49 +0100 + +openais (0.91-0ubuntu2.2) jaunty; urgency=low + + * Svn up to 1676. + + -- Fabio M. Di Nitto Fri, 23 Jan 2009 05:55:38 +0100 + +openais (0.91-0ubuntu2.1) jaunty; urgency=low + + * Add checkpoint bug fixes + + -- Fabio M. Di Nitto Wed, 14 Jan 2009 20:08:10 +0100 + +openais (0.91-0ubuntu2) jaunty; urgency=low + + * Svn up to 1672. + + -- Fabio M. Di Nitto Wed, 14 Jan 2009 14:43:37 +0100 + +openais (0.91-0ubuntu1) jaunty; urgency=low + + * New upstream version release + svn 1671. + + -- Fabio M. Di Nitto Tue, 06 Jan 2009 10:06:35 +0100 + +openais (0.90-0ubuntu5) intrepid; urgency=low + + * Upload to intrepid. Obsolete version in PPA. + + -- Fabio M. Di Nitto Wed, 20 Aug 2008 12:49:16 +0200 + +openais (0.90-0ubuntu4) intrepid; urgency=low + + * openais.init: fix to handle corosync/openais split. + + -- Fabio M. Di Nitto Wed, 20 Aug 2008 08:26:28 +0200 + +openais (0.90-0ubuntu3) intrepid; urgency=low + + * Update to svn trunk at 1638. + * debian/control: build against latest corosync. + * drop local patches now upstream. + + -- Fabio M. Di Nitto Wed, 20 Aug 2008 07:44:33 +0200 + +openais (0.90-0ubuntu2) intrepid; urgency=low + + * Update to svn trunk at 1627. + * debian/control: update descriptions and dependencies. + * debian/copyright: update upstream location and other bits. + * debian/*: general fixup for binaries split up from corosync. + * Move lcrso files to /usr/lib/lcrso (common with new corosync). + * add 001_nodl patch to stop linking with libdl that is not used by any + binary. + + -- Fabio M. Di Nitto Wed, 13 Aug 2008 06:31:28 +0200 + +openais (0.90-0ubuntu1) intrepid; urgency=low + + * New source based on upstream split of the tree into corosync and openais. + + -- Fabio M. Di Nitto Thu, 24 Jul 2008 08:53:47 +0200 + +openais (0.84-0ubuntu2) intrepid; urgency=low + + * Update to latest SVN + + -- Fabio M. Di Nitto Tue, 15 Jul 2008 12:18:03 +0200 + +openais (0.84-0ubuntu1) intrepid; urgency=low + + * New upstream release + + -- Fabio M. Di Nitto Tue, 24 Jun 2008 08:41:53 +0200 + +openais (0.83-1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Drop parisc/hppa workaround bits from debian/rules. + - Drop debian/README.Debian. It doesn't apply to Ubuntu. + - Ship and install init script. + - Install logrotate bit. + - Fix lcrso permissions. + + -- Fabio M. Di Nitto Mon, 09 Jun 2008 09:25:11 +0200 + +openais (0.83-1) unstable; urgency=low + + * New upstream version. + * Merge (partially) with Ubuntu: + - Fix dh_* invokation order in debian/rules. + - drop unrequired patches. + - Fix executive startup issue if it can't open a logging file. + - Fix liblogsys linking issues. + - create logrotate script + - add postrm + + -- Frederik Schüler Tue, 03 Jun 2008 22:44:19 +0200 + +openais (0.83-0ubuntu3) intrepid; urgency=low + + * Fix liblogsys linking issues. + + * Fix executive startup issue if it can't open a logging file. + + -- Fabio M. Di Nitto Tue, 20 May 2008 10:02:59 +0200 + +openais (0.83-0ubuntu2) intrepid; urgency=low + + * debian/rules: + - Fix dh_* invokation order. + + -- Fabio M. Di Nitto Tue, 13 May 2008 06:38:08 +0200 + +openais (0.83-0ubuntu1) intrepid; urgency=low + + * New upstream release: + - drop unrequired patches. + + -- Fabio M. Di Nitto Tue, 13 May 2008 05:53:19 +0200 + +openais (0.82-3ubuntu2) hardy; urgency=low + + * New svn snapshot "Getting close to 0.83" release: + - Update patch 000. + - Drop patch 001. Now upstream. + - Drop patch 004 as final decision with upstream. + It will be reintroduced after 1.0 release for the new + development tree. + + -- Fabio M. Di Nitto Mon, 21 Jan 2008 06:54:28 +0100 + +openais (0.82-3ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - Ubuntu maintainer foobar. + - Provide init script for standalone aisexec. + - Run trunk in preparation of 0.83 release. + - debian/rules: add ARCH in build and stamp targets. + - debian/rules: adapt to install trunk. + - debian/rules: chmod lcrso file instead of patching upstream Makefiles. + - provide log rotate bits for aisexec standalone logs. + - debian/patches/: + + use trunk. + + slightly change default conf (required for init scripts). + + increase max rings from 2 to 4. + - drop all debian patches in favours of ubuntu ones as they are + the same, but based on trunk. + + -- Fabio M. Di Nitto Wed, 09 Jan 2008 07:31:36 +0100 + +openais (0.82-3) unstable; urgency=low + + * Fix FTBFS on hppa. + * Update to new standards version. + + -- Frederik Schüler Mon, 24 Dec 2007 23:55:27 +0100 + +openais (0.82-2) unstable; urgency=low + + * Install openais/service/logsys.h + + -- Frederik Schüler Mon, 03 Dec 2007 00:35:46 +0100 + +openais (0.82-1) unstable; urgency=low + + [ Bastian Blank ] + * Drop unnecessary patches. + + [ Frederik Schüler ] + * New upstream release (Closes: #453438) + * Add myself to uploaders. + * Rediff 001_makefile.dpatch + * Drop 002_fix_include_path.dpatch + + -- Frederik Schüler Sun, 02 Dec 2007 15:27:15 +0100 + +openais (0.82-0ubuntu14) hardy; urgency=low + + * Re-enable patch 004. Found the bug in cman and fix is about + to be uploaded. + + -- Fabio M. Di Nitto Wed, 02 Jan 2008 11:34:56 +0100 + +openais (0.82-0ubuntu13) hardy; urgency=low + + * Temporary disable patch 004 introduced in 0.82-0ubuntu7: + Part of the code does not use this value directly but rather some + embedded "version" of it. The result is memory corruption all over + the place. A bug has been filed upstream. + + -- Fabio M. Di Nitto Tue, 01 Jan 2008 06:55:48 +0100 + +openais (0.82-0ubuntu12) hardy; urgency=low + + * Update patch 001: re-add call to log_printf + error_string. + The bug was triggered by bad code in rhcs/cman. + + -- Fabio M. Di Nitto Mon, 31 Dec 2007 06:11:10 +0100 + +openais (0.82-0ubuntu11) hardy; urgency=low + + * Update patch 001 to fix install of EXECLIBS. Doesn't affect packaging. + + * Update patch 001 to remove unsafe call to log_printf + error_string. + + * Update patch 001 to better handle close of file descriptors. + + * debian/rules: add $ARCH to build and stamp dirs. Very helpful when + building on several arches at the same time. + + -- Fabio M. Di Nitto Sun, 30 Dec 2007 09:40:18 +0100 + +openais (0.82-0ubuntu10) hardy; urgency=low + + * Fix once again closing of fd's upstream borkage. + + -- Fabio M. Di Nitto Mon, 24 Dec 2007 07:58:57 +0100 + +openais (0.82-0ubuntu9) hardy; urgency=low + + * Add workaround to build on hppa/parisc by reducing the optimization + to -O1. Both -O2 and -O3 trigger a gcc ICE. + + -- Fabio M. Di Nitto Sun, 23 Dec 2007 08:43:26 +0100 + +openais (0.82-0ubuntu8) hardy; urgency=low + + * Also install openais-cfgtool. + + -- Soren Hansen Fri, 14 Dec 2007 13:13:40 +0100 + +openais (0.82-0ubuntu7) hardy; urgency=low + + [ Fabio M. Di Nitto ] + * Update to SVN trunk in preparation of 0.83. + * rediff all patches. + + [ Soren Hansen ] + * 004_increase_max_rings.dpatch: Increase INTERFACE_MAX to 4 (LP: #176299) + Thanks Fabio! + + -- Soren Hansen Fri, 14 Dec 2007 09:34:53 +0100 + +openais (0.82-0ubuntu6) hardy; urgency=low + + * Add patch to fix closing fd's in daemonized mode. + + -- Fabio M. Di Nitto Tue, 30 Oct 2007 08:20:58 +0100 + +openais (0.82-0ubuntu5) hardy; urgency=low + + * Switch to trunk as 0.83 is about to be released. + + -- Fabio M. Di Nitto Tue, 30 Oct 2007 06:21:31 +0100 + +openais (0.82-0ubuntu4) hardy; urgency=low + + * Add one more case for RH bugzilla 314641. + + -- Fabio M. Di Nitto Mon, 29 Oct 2007 20:20:51 +0100 + +openais (0.82-0ubuntu3) hardy; urgency=low + + * Add fix for RH bugzilla 314641. + + -- Fabio M. Di Nitto Mon, 29 Oct 2007 19:06:02 +0100 + +openais (0.82-0ubuntu2) hardy; urgency=low + + * Add missing 001_Makefile patch. + + -- Fabio M. Di Nitto Wed, 24 Oct 2007 05:49:36 +0200 + +openais (0.82-0ubuntu1) hardy; urgency=low + + * Switch to 0.82 release. + + * Sync with Debian - remaining changes: + - debian/control: + + Ubuntu maintainer foobar. + + openais: retain Depends: lsb-base for init script. + - debian/rules: + + chmod 644 *.lcrso + + dh_installinit + + dh_installlogrotate + + define STATICLIBS=yes in install target + - debian/openais.install: + + etc/ais + - debian/openais.{default,dirs,init,logrotate,postinst,postrm}: + + required for the overall init system not shipped in Debian + - debian/patches: + + 000_for_upstream: required to install 0.82 properly (pushed) + + 001_makefile: different from debian and resynced for 0.82 + + 003_default_conf: fix default conf to match FHS (not in Debian) + + -- Fabio M. Di Nitto Mon, 22 Oct 2007 05:37:06 +0200 + +openais (0.81-1) unstable; urgency=low + + * Initial Release (closes: #421816). + - Pull tarball from Ubuntu. + + -- Bastian Blank Thu, 07 Jun 2007 10:21:43 +0200 + +openais (0.81-0ubuntu5) gutsy; urgency=low + + * Import a bunch of bugfixes from svn trunk. + + -- Fabio M. Di Nitto Mon, 01 Oct 2007 04:47:48 +0200 + +openais (0.81-0ubuntu4) gutsy; urgency=low + + * Switch to trunk (r1384) + + -- Fabio M. Di Nitto Tue, 22 May 2007 07:01:39 +0200 + +openais (0.81-0ubuntu3) gutsy; urgency=low + + * Fix include madness with patch reworked with upstream. + + -- Fabio M. Di Nitto Thu, 03 May 2007 16:30:38 +0200 + +openais (0.81-0ubuntu2) gutsy; urgency=low + + * Remove recursive link in /usr/include/openais. It's not required + anylonger. + + -- Fabio M. Di Nitto Thu, 03 May 2007 15:02:37 +0200 + +openais (0.81-0ubuntu1) gutsy; urgency=low + + * New upstream release: + - generated orig.tar.gz from svn export (not available from main download + web site) + - fix openais ../include madness. Add patch 002_fix_include_path.dpatch. + - update patch 003_default_conf.dpatch + + -- Fabio M. Di Nitto Fri, 20 Apr 2007 10:24:58 +0200 + +openais (0.80.2-0ubuntu1) feisty; urgency=low + + * New upstream release from whitetank branch. + + -- Fabio M. Di Nitto Wed, 10 Jan 2007 07:16:50 +0100 + +openais (0.80.1-0ubuntu2) feisty; urgency=low + + * Update from svn whitetank branch (r1284). + + -- Fabio M. Di Nitto Mon, 23 Oct 2006 07:45:10 +0200 + +openais (0.80.1-0ubuntu1) edgy; urgency=low + + * New upstream release. Exception granted by Matt Zimmerman. + (Closes Ubuntu: #61854) + + * Fix debian/rules to not remove wrong files. + + * Fix clean target in test/Makefile and lib/Makefile. + + -- Fabio M. Di Nitto Wed, 27 Sep 2006 18:57:12 +0200 + +openais (0.79-0ubuntu6) edgy; urgency=low + + * Update to whitetank stable branch. + + -- Fabio M. Di Nitto Tue, 22 Aug 2006 10:06:14 +0200 + +openais (0.79-0ubuntu5) edgy; urgency=low + + * Drop patch 007 to prefer IPv6 over IPv4. cman now tells us what to prefer + according to the select multicast address. + + -- Fabio M. Di Nitto Tue, 25 Jul 2006 09:45:16 +0200 + +openais (0.79-0ubuntu4) edgy; urgency=low + + * Import another big fat bunch of bug fixes from upstream. + + -- Fabio M. Di Nitto Mon, 24 Jul 2006 06:21:17 +0200 + +openais (0.79-0ubuntu3) edgy; urgency=low + + * Fix libopenais2 for good. + + -- Fabio M. Di Nitto Thu, 20 Jul 2006 04:49:28 +0200 + +openais (0.79-0ubuntu2) edgy; urgency=low + + * Fix libopenais-dev Depends. + + -- Fabio M. Di Nitto Thu, 20 Jul 2006 04:36:48 +0200 + +openais (0.79-0ubuntu1) edgy; urgency=low + + * New upstream release: + - bump soname. + - rediff patches. + - UVF exception granted by Colin Watson. + + * Fix init scripts to stop the daemon properly. + + * Add patch to fix ipv6 multicast parsing. + + * Add patch to fix ipv6 resolver order. + + -- Fabio M. Di Nitto Tue, 18 Jul 2006 09:27:20 +0200 + +openais (0.78-0ubuntu2) edgy; urgency=low + + * Wrap call to adduser. + + * Use lsb init scripts. + + -- Fabio M. Di Nitto Mon, 17 Jul 2006 11:49:51 +0200 + +openais (0.78-0ubuntu1) edgy; urgency=low + + * First release. + + -- Fabio M. Di Nitto Fri, 07 Jul 2006 08:23:23 +0200 + --- openais-0.91.orig/debian/patches/00list +++ openais-0.91/debian/patches/00list @@ -0,0 +1,4 @@ +000_trunk.dpatch +001_ckp.dpatch +100_makefile.dpatch +101_default_conf.dpatch --- openais-0.91.orig/debian/patches/001_ckp.dpatch +++ openais-0.91/debian/patches/001_ckp.dpatch @@ -0,0 +1,963 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 001_ckp.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad openais-0.91~/services/ckpt.c openais-0.91/services/ckpt.c +--- openais-0.91~/services/ckpt.c 2009-01-14 20:06:28.000000000 +0100 ++++ openais-0.91/services/ckpt.c 2009-01-14 20:06:33.000000000 +0100 +@@ -1,10 +1,10 @@ + /* + * Copyright (c) 2003-2006 MontaVista Software, Inc. +- * Copyright (c) 2006-2007 Red Hat, Inc. ++ * Copyright (c) 2006-2008 Red Hat, Inc. + * + * All rights reserved. + * +- * Authors: Steven Dake (sdake@redhat.com) ++ * Authors: Steven Dake (sdake@mredhat.com) + * Muni Bajpai (muni.osdl@gmail.com) + * + * This software licensed under BSD license, the text of which follows: +@@ -55,13 +55,16 @@ + #include + #include + #include ++ + #include "../include/saAis.h" +-#include "../include/saEvt.h" +-#include "../include/ipc_ckpt.h" ++#include "../include/saCkpt.h" + #include "../include/mar_ckpt.h" ++#include "../include/ipc_ckpt.h" + + LOGSYS_DECLARE_SUBSYS ("CKPT", LOG_INFO); + ++#define GLOBALID_CHECKPOINT_NAME "global_checkpoint_name_do_not_use_in_an_application" ++ + #define CKPT_MAX_SECTION_DATA_SEND (1024*400) + + enum ckpt_message_req_types { +@@ -89,6 +92,9 @@ + }; + + enum sync_state { ++ SYNC_STATE_NOT_STARTED, ++ SYNC_STATE_STARTED, ++ SYNC_STATE_GLOBALID, + SYNC_STATE_CHECKPOINT, + SYNC_STATE_REFCOUNT + }; +@@ -153,6 +159,7 @@ + + struct checkpoint { + struct list_head list; ++ struct list_head expiry_list; + mar_name_t name; + mar_uint32_t ckpt_id; + mar_ckpt_checkpoint_creation_attributes_t checkpoint_creation_attributes; +@@ -196,8 +203,6 @@ + + static int ckpt_lib_init_fn (void *conn); + +-static void ckpt_dump_fn (void); +- + static void message_handler_req_lib_ckpt_checkpointopen ( + void *conn, + void *msg); +@@ -366,23 +371,29 @@ + + DECLARE_LIST_INIT(checkpoint_recovery_list_head); + ++DECLARE_LIST_INIT(my_checkpoint_expiry_list_head); ++ + static struct corosync_api_v1 *api; + + static mar_uint32_t global_ckpt_id = 0; + +-static enum sync_state my_sync_state; ++static enum sync_state my_sync_state = SYNC_STATE_NOT_STARTED; + + static enum iteration_state my_iteration_state; + +-static struct list_head *my_iteration_state_checkpoint; ++static struct list_head *my_iteration_state_checkpoint_list; + +-static struct list_head *my_iteration_state_section; ++static struct list_head *my_iteration_state_section_list; + +-static unsigned int my_member_list[PROCESSOR_COUNT_MAX]; ++static unsigned int my_old_member_list[PROCESSOR_COUNT_MAX]; + +-static unsigned int my_member_list_entries = 0; ++static unsigned int my_old_member_list_entries = 0; + +-static unsigned int my_lowest_nodeid = 0; ++static unsigned int my_should_sync = 0; ++ ++static unsigned int my_token_callback_active = 0; ++ ++static void * my_token_callback_handle; + + struct checkpoint_cleanup { + struct list_head list; +@@ -570,7 +581,7 @@ + }; + + struct corosync_service_engine ckpt_service_engine = { +- .name = "openais checkpoint service B.01.01", ++ .name = (char *)"corosync checkpoint service B.01.01", + .id = CKPT_SERVICE, + .private_data_size = sizeof (struct ckpt_pd), + .flow_control = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED, +@@ -579,7 +590,7 @@ + .lib_engine = ckpt_lib_engine, + .lib_engine_count = sizeof (ckpt_lib_engine) / sizeof (struct corosync_lib_handler), + .exec_init_fn = ckpt_exec_init_fn, +- .exec_dump_fn = ckpt_dump_fn, ++ .exec_dump_fn = 0, + .exec_engine = ckpt_exec_engine, + .exec_engine_count = sizeof (ckpt_exec_engine) / sizeof (struct corosync_exec_handler), + .confchg_fn = ckpt_confchg_fn, +@@ -598,7 +609,7 @@ + .corosync_get_service_engine_ver0 = ckpt_get_handler_ver0 + }; + +-static struct lcr_iface openais_ckpt_ver0[1] = { ++static struct lcr_iface corosync_ckpt_ver0[1] = { + { + .name = "openais_ckpt", + .version = 0, +@@ -614,7 +625,7 @@ + + static struct lcr_comp ckpt_comp_ver0 = { + .iface_count = 1, +- .ifaces = openais_ckpt_ver0 ++ .ifaces = corosync_ckpt_ver0 + }; + + static struct corosync_service_engine *ckpt_get_handler_ver0 (void) +@@ -623,7 +634,7 @@ + } + + __attribute__ ((constructor)) static void register_this_component (void) { +- lcr_interfaces_set (&openais_ckpt_ver0[0], &ckpt_service_engine_iface); ++ lcr_interfaces_set (&corosync_ckpt_ver0[0], &ckpt_service_engine_iface); + + lcr_component_register (&ckpt_comp_ver0); + } +@@ -757,51 +768,11 @@ + mar_refcount_set_t refcount_set[PROCESSOR_COUNT_MAX] __attribute__((aligned(8))); + }; + ++static int first_configuration = 1; ++ + /* + * Implementation + */ +- +-void clean_checkpoint_list(struct list_head *head) +-{ +- struct list_head *checkpoint_list; +- struct checkpoint *checkpoint; +- +- if (list_empty(head)) { +- log_printf (LOG_LEVEL_DEBUG, "clean_checkpoint_list: List is empty \n"); +- return; +- } +- +- checkpoint_list = head->next; +- while (checkpoint_list != head) { +- checkpoint = list_entry (checkpoint_list, +- struct checkpoint, list); +- assert (checkpoint > 0); +- +- /* +- * If checkpoint has been unlinked and this is the last reference, delete it +- */ +- if (checkpoint->unlinked && checkpoint->reference_count == 0) { +- log_printf (LOG_LEVEL_DEBUG,"clean_checkpoint_list: deallocating checkpoint %s.\n", +- checkpoint->name.value); +- checkpoint_list = checkpoint_list->next; +- checkpoint_release (checkpoint); +- continue; +- +- } +- else if (checkpoint->reference_count == 0) { +- log_printf (LOG_LEVEL_DEBUG, "clean_checkpoint_list: Starting timer to release checkpoint %s.\n", +- checkpoint->name.value); +- api->timer_delete (checkpoint->retention_timer); +- api->timer_add_duration ( +- checkpoint->checkpoint_creation_attributes.retention_duration, +- checkpoint, +- timer_function_retention, +- &checkpoint->retention_timer); +- } +- checkpoint_list = checkpoint_list->next; +- } +-} +- + static void ckpt_confchg_fn ( + enum totem_configuration_type configuration_type, + unsigned int *member_list, int member_list_entries, +@@ -810,40 +781,45 @@ + struct memb_ring_id *ring_id) + { + unsigned int i, j; ++ unsigned int lowest_nodeid; + +- /* +- * Determine lowest nodeid in old regular configuration for the +- * purpose of executing the synchronization algorithm +- */ +- if (configuration_type == TOTEM_CONFIGURATION_TRANSITIONAL) { +- for (i = 0; i < left_list_entries; i++) { +- for (j = 0; j < my_member_list_entries; j++) { +- if (left_list[i] == my_member_list[j]) { +- my_member_list[j] = 0; +- } +- } +- } +- } +- +- my_lowest_nodeid = 0xffffffff; ++ memcpy (&my_saved_ring_id, ring_id, ++ sizeof (struct memb_ring_id)); ++ if (configuration_type != TOTEM_CONFIGURATION_REGULAR) { ++ return; ++ } ++ if (my_sync_state != SYNC_STATE_NOT_STARTED) { ++ return; ++ } ++ ++ my_sync_state = SYNC_STATE_STARTED; ++ ++ my_should_sync = 0; + + /* + * Handle regular configuration + */ +- if (configuration_type == TOTEM_CONFIGURATION_REGULAR) { +- memcpy (my_member_list, member_list, +- sizeof (unsigned int) * member_list_entries); +- my_member_list_entries = member_list_entries; +- memcpy (&my_saved_ring_id, ring_id, +- sizeof (struct memb_ring_id)); +- for (i = 0; i < my_member_list_entries; i++) { +- if ((my_member_list[i] != 0) && +- (my_member_list[i] < my_lowest_nodeid)) { ++ lowest_nodeid = 0xffffffff; + +- my_lowest_nodeid = my_member_list[i]; ++ for (i = 0; i < my_old_member_list_entries; i++) { ++ for (j = 0; j < member_list_entries; j++) { ++ if (my_old_member_list[i] == member_list[j]) { ++ if (lowest_nodeid > member_list[j]) { ++ lowest_nodeid = member_list[j]; ++ } + } + } + } ++ memcpy (my_old_member_list, member_list, ++ sizeof (unsigned int) * member_list_entries); ++ my_old_member_list_entries = member_list_entries; ++ ++ if ((first_configuration) || ++ (lowest_nodeid == api->totem_nodeid_get())) { ++ ++ my_should_sync = 1; ++ } ++ first_configuration = 0; + } + + static struct checkpoint *checkpoint_find ( +@@ -1058,9 +1034,7 @@ + iovec.iov_base = (char *)&req_exec_ckpt_checkpointclose; + iovec.iov_len = sizeof (req_exec_ckpt_checkpointclose); + +- assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0); +- +- return (-1); ++ return (api->totem_mcast (&iovec, 1, TOTEM_AGREED)); + } + + static int ckpt_exec_init_fn (struct corosync_api_v1 *corosync_api) +@@ -1282,13 +1256,13 @@ + /* + * If checkpoint doesn't exist, create one + */ +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + if ((req_exec_ckpt_checkpointopen->checkpoint_open_flags & SA_CKPT_CHECKPOINT_CREATE) == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } + checkpoint = malloc (sizeof (struct checkpoint)); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NO_MEMORY; + goto error_exit; + } +@@ -1302,6 +1276,7 @@ + checkpoint->unlinked = 0; + list_init (&checkpoint->list); + list_init (&checkpoint->sections_list_head); ++ list_init (&checkpoint->expiry_list); + list_add (&checkpoint->list, &checkpoint_list_head); + checkpoint->reference_count = 1; + checkpoint->retention_timer = 0; +@@ -1349,6 +1324,12 @@ + checkpoint_section->expiration_timer = 0; + } + } else { ++ /* ++ * We have to ignore the retention_duration attribute ++ */ ++ req_exec_ckpt_checkpointopen->checkpoint_creation_attributes.retention_duration = ++ checkpoint->checkpoint_creation_attributes.retention_duration; ++ + if (req_exec_ckpt_checkpointopen->checkpoint_creation_attributes_set && + memcmp (&checkpoint->checkpoint_creation_attributes, + &req_exec_ckpt_checkpointopen->checkpoint_creation_attributes, +@@ -1480,7 +1461,7 @@ + &checkpoint_list_head, + &ckpt_id->ckpt_name, + ckpt_id->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + log_printf (LOG_LEVEL_ERROR, "timer_function_section_expire could not find ckpt %s\n", + ckpt_id->ckpt_name.value); + goto free_mem; +@@ -1508,29 +1489,67 @@ + + } + +-void timer_function_retention (void *data) ++int callback_expiry (enum totem_callback_token_type type, void *data) + { + struct checkpoint *checkpoint = (struct checkpoint *)data; +- struct req_exec_ckpt_checkpointretentiondurationexpire req_exec_ckpt_checkpointretentiondurationexpire; ++ struct req_exec_ckpt_checkpointunlink req_exec_ckpt_checkpointunlink; + struct iovec iovec; ++ unsigned int res; ++ struct list_head *list; + +- checkpoint->retention_timer = 0; +- req_exec_ckpt_checkpointretentiondurationexpire.header.size = +- sizeof (struct req_exec_ckpt_checkpointretentiondurationexpire); +- req_exec_ckpt_checkpointretentiondurationexpire.header.id = +- SERVICE_ID_MAKE (CKPT_SERVICE, +- MESSAGE_REQ_EXEC_CKPT_CHECKPOINTRETENTIONDURATIONEXPIRE); ++ list = my_checkpoint_expiry_list_head.next; ++ while (!list_empty(&my_checkpoint_expiry_list_head)) { ++ checkpoint = list_entry (list, ++ struct checkpoint, expiry_list); + +- memcpy (&req_exec_ckpt_checkpointretentiondurationexpire.checkpoint_name, +- &checkpoint->name, +- sizeof (mar_name_t)); +- req_exec_ckpt_checkpointretentiondurationexpire.ckpt_id = +- checkpoint->ckpt_id; ++ if (checkpoint->reference_count == 0) { ++ req_exec_ckpt_checkpointunlink.header.size = ++ sizeof (struct req_exec_ckpt_checkpointunlink); ++ req_exec_ckpt_checkpointunlink.header.id = ++ SERVICE_ID_MAKE (CKPT_SERVICE, ++ MESSAGE_REQ_EXEC_CKPT_CHECKPOINTUNLINK); + +- iovec.iov_base = (char *)&req_exec_ckpt_checkpointretentiondurationexpire; +- iovec.iov_len = sizeof (req_exec_ckpt_checkpointretentiondurationexpire); ++ req_exec_ckpt_checkpointunlink.source.conn = 0; ++ req_exec_ckpt_checkpointunlink.source.nodeid = 0; + +- assert (api->totem_mcast (&iovec, 1, TOTEM_AGREED) == 0); ++ memcpy (&req_exec_ckpt_checkpointunlink.checkpoint_name, ++ &checkpoint->name, ++ sizeof (mar_name_t)); ++ ++ iovec.iov_base = (char *)&req_exec_ckpt_checkpointunlink; ++ iovec.iov_len = sizeof (req_exec_ckpt_checkpointunlink); ++ ++ res = api->totem_mcast (&iovec, 1, TOTEM_AGREED); ++ if (res == -1) { ++ return (-1); ++ } ++ log_printf (LOG_LEVEL_DEBUG, ++ "Expiring checkpoint %s\n", ++ get_mar_name_t (&checkpoint->name)); ++ } ++ ++ list_del (&checkpoint->expiry_list); ++ list = my_checkpoint_expiry_list_head.next; ++ } ++ my_token_callback_active = 0; ++ return (0); ++} ++ ++void timer_function_retention (void *data) ++{ ++ struct checkpoint *checkpoint = (struct checkpoint *)data; ++ checkpoint->retention_timer = 0; ++ list_add (&checkpoint->expiry_list, &my_checkpoint_expiry_list_head); ++ ++ if (my_token_callback_active == 0) { ++ api->totem_callback_token_create ( ++ &my_token_callback_handle, ++ TOTEM_CALLBACK_TOKEN_SENT, ++ 1, ++ callback_expiry, ++ NULL); ++ my_token_callback_active = 1; ++ } + } + + static void message_handler_req_exec_ckpt_checkpointclose ( +@@ -1550,7 +1569,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_checkpointclose->checkpoint_name, + req_exec_ckpt_checkpointclose->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1588,8 +1607,10 @@ + res_lib_ckpt_checkpointclose.header.size = sizeof (struct res_lib_ckpt_checkpointclose); + res_lib_ckpt_checkpointclose.header.id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTCLOSE; + res_lib_ckpt_checkpointclose.header.error = error; +- api->ipc_conn_send_response (req_exec_ckpt_checkpointclose->source.conn, +- &res_lib_ckpt_checkpointclose, sizeof (struct res_lib_ckpt_checkpointclose)); ++ api->ipc_conn_send_response ( ++ req_exec_ckpt_checkpointclose->source.conn, ++ &res_lib_ckpt_checkpointclose, ++ sizeof (struct res_lib_ckpt_checkpointclose)); + } + + /* +@@ -1614,7 +1635,7 @@ + checkpoint = checkpoint_find_linked ( + &checkpoint_list_head, + &req_exec_ckpt_checkpointunlink->checkpoint_name); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1709,10 +1730,8 @@ + &checkpoint_list_head, + &req_exec_ckpt_checkpointretentiondurationexpire->checkpoint_name, + req_exec_ckpt_checkpointretentiondurationexpire->ckpt_id); +- log_printf (LOG_LEVEL_NOTICE, "Expiring checkpoint %s\n", +- get_mar_name_t (&req_exec_ckpt_checkpointretentiondurationexpire->checkpoint_name)); + if (checkpoint && (checkpoint->reference_count == 0)) { +- log_printf (LOG_LEVEL_NOTICE, "Expiring checkpoint %s\n", ++ log_printf (LOG_LEVEL_DEBUG, "Expiring checkpoint %s\n", + get_mar_name_t (&req_exec_ckpt_checkpointretentiondurationexpire->checkpoint_name)); + + req_exec_ckpt_checkpointunlink.header.size = +@@ -1754,7 +1773,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectioncreate->checkpoint_name, + req_exec_ckpt_sectioncreate->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1897,7 +1916,8 @@ + res_lib_ckpt_sectioncreate.header.id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONCREATE; + res_lib_ckpt_sectioncreate.header.error = error; + +- api->ipc_conn_send_response (req_exec_ckpt_sectioncreate->source.conn, ++ api->ipc_conn_send_response ( ++ req_exec_ckpt_sectioncreate->source.conn, + &res_lib_ckpt_sectioncreate, + sizeof (struct res_lib_ckpt_sectioncreate)); + } +@@ -1917,7 +1937,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectiondelete->checkpoint_name, + req_exec_ckpt_sectiondelete->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1985,7 +2005,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionexpirationtimeset->checkpoint_name, + req_exec_ckpt_sectionexpirationtimeset->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -2079,7 +2099,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionwrite->checkpoint_name, + req_exec_ckpt_sectionwrite->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + log_printf (LOG_LEVEL_ERROR, "checkpoint_find returned 0 Calling error_exit.\n"); + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; +@@ -2188,7 +2208,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionoverwrite->checkpoint_name, + req_exec_ckpt_sectionoverwrite->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -2288,7 +2308,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionread->checkpoint_name, + req_exec_ckpt_sectionread->ckpt_id); +- if (checkpoint == NULL) { ++ if (checkpoint == 0) { + error = SA_AIS_ERR_LIBRARY; + goto error_exit; + } +@@ -2391,6 +2411,7 @@ + struct checkpoint_cleanup *checkpoint_cleanup; + struct list_head *list; + struct ckpt_pd *ckpt_pd = (struct ckpt_pd *)api->ipc_private_data_get (conn); ++ unsigned int res; + + log_printf (LOG_LEVEL_DEBUG, "checkpoint exit conn %p\n", conn); + +@@ -2404,9 +2425,16 @@ + struct checkpoint_cleanup, list); + + assert (checkpoint_cleanup->checkpoint_name.length != 0); +- ckpt_checkpoint_close ( ++ res = ckpt_checkpoint_close ( + &checkpoint_cleanup->checkpoint_name, + checkpoint_cleanup->ckpt_id); ++ /* ++ * If checkpoint_close fails because of full totem queue ++ * return -1 ande try again later ++ */ ++ if (res == -1) { ++ return (-1); ++ } + + list_del (&checkpoint_cleanup->list); + free (checkpoint_cleanup); +@@ -2566,15 +2594,11 @@ + /* + * Make sure checkpoint is collocated and async update option + */ +- if (checkpoint == NULL) { +- error = SA_AIS_ERR_NOT_EXIST; +- } else + if (((checkpoint->checkpoint_creation_attributes.creation_flags & SA_CKPT_CHECKPOINT_COLLOCATED) == 0) || + (checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + error = SA_AIS_ERR_BAD_OPERATION; +- } else { +- checkpoint->active_replica_set = 1; + } ++ checkpoint->active_replica_set = 1; + res_lib_ckpt_activereplicaset.header.size = sizeof (struct res_lib_ckpt_activereplicaset); + res_lib_ckpt_activereplicaset.header.id = MESSAGE_RES_CKPT_ACTIVEREPLICASET; + res_lib_ckpt_activereplicaset.header.error = error; +@@ -2656,8 +2680,6 @@ + struct req_exec_ckpt_sectioncreate req_exec_ckpt_sectioncreate; + struct iovec iovecs[2]; + +- log_printf (LOG_LEVEL_DEBUG, "Section create from conn %p\n", conn); +- + req_exec_ckpt_sectioncreate.header.id = + SERVICE_ID_MAKE (CKPT_SERVICE, + MESSAGE_REQ_EXEC_CKPT_SECTIONCREATE); +@@ -2693,7 +2715,6 @@ + } + + if (iovecs[1].iov_len > 0) { +- log_printf (LOG_LEVEL_DEBUG, "IOV_BASE is %p\n", iovecs[1].iov_base); + assert (api->totem_mcast (iovecs, 2, TOTEM_AGREED) == 0); + } else { + assert (api->totem_mcast (iovecs, 1, TOTEM_AGREED) == 0); +@@ -2956,9 +2977,6 @@ + &checkpoint_list_head, + &req_lib_ckpt_checkpointsynchronize->checkpoint_name, + req_lib_ckpt_checkpointsynchronize->ckpt_id); +- if (checkpoint == NULL) { +- res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_ERR_NOT_EXIST; +- } else + if ((checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_ERR_BAD_OPERATION; + } else +@@ -2989,9 +3007,6 @@ + &checkpoint_list_head, + &req_lib_ckpt_checkpointsynchronizeasync->checkpoint_name, + req_lib_ckpt_checkpointsynchronizeasync->ckpt_id); +- if (checkpoint == NULL) { +- res_lib_ckpt_checkpointsynchronizeasync.header.error = SA_AIS_ERR_NOT_EXIST; +- } else + if ((checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + res_lib_ckpt_checkpointsynchronizeasync.header.error = SA_AIS_ERR_BAD_OPERATION; + } else +@@ -3137,10 +3152,9 @@ + res_lib_ckpt_sectioniterationinitialize.header.id = MESSAGE_RES_CKPT_SECTIONITERATIONINITIALIZE; + res_lib_ckpt_sectioniterationinitialize.header.error = error; + res_lib_ckpt_sectioniterationinitialize.iteration_handle = iteration_handle; +- if (checkpoint != NULL) { +- res_lib_ckpt_sectioniterationinitialize.max_section_id_size = +- checkpoint->checkpoint_creation_attributes.max_section_id_size; +- } ++ res_lib_ckpt_sectioniterationinitialize.max_section_id_size = ++ checkpoint->checkpoint_creation_attributes.max_section_id_size; ++ + api->ipc_conn_send_response ( + conn, + &res_lib_ckpt_sectioniterationinitialize, +@@ -3374,19 +3388,29 @@ + list_init (ckpt_list_head); + } + +-static inline void sync_checkpoints_enter (void) ++static inline void sync_gloalid_enter (void) + { + struct checkpoint *checkpoint; + + ENTER(); + +- my_sync_state = SYNC_STATE_CHECKPOINT; +- my_iteration_state = ITERATION_STATE_CHECKPOINT; +- my_iteration_state_checkpoint = checkpoint_list_head.next; ++ my_sync_state = SYNC_STATE_GLOBALID; ++ ++ my_iteration_state_checkpoint_list = checkpoint_list_head.next; + + checkpoint = list_entry (checkpoint_list_head.next, struct checkpoint, + list); +- my_iteration_state_section = checkpoint->sections_list_head.next; ++ my_iteration_state_section_list = checkpoint->sections_list_head.next; ++ ++ LEAVE(); ++} ++ ++static inline void sync_checkpoints_enter (void) ++{ ++ ENTER(); ++ ++ my_sync_state = SYNC_STATE_CHECKPOINT; ++ my_iteration_state = ITERATION_STATE_CHECKPOINT; + + LEAVE(); + } +@@ -3394,13 +3418,15 @@ + static inline void sync_refcounts_enter (void) + { + my_sync_state = SYNC_STATE_REFCOUNT; ++ ++ my_iteration_state_checkpoint_list = checkpoint_list_head.next; + } + + static void ckpt_sync_init (void) + { + ENTER(); + +- sync_checkpoints_enter(); ++ sync_gloalid_enter(); + + LEAVE(); + } +@@ -3440,6 +3466,19 @@ + return (api->totem_mcast (&iovec, 1, TOTEM_AGREED)); + } + ++static int sync_checkpoint_globalid_transmit (void) ++{ ++ struct checkpoint checkpoint; ++ ++ strcpy ((char *)checkpoint.name.value, GLOBALID_CHECKPOINT_NAME); ++ ++ checkpoint.name.length = strlen (GLOBALID_CHECKPOINT_NAME); ++ checkpoint.ckpt_id = global_ckpt_id; ++ ++ return (sync_checkpoint_transmit(&checkpoint)); ++} ++ ++ + static int sync_checkpoint_section_transmit ( + struct checkpoint *checkpoint, + struct checkpoint_section *checkpoint_section) +@@ -3478,7 +3517,7 @@ + + iovecs[0].iov_base = (char *)&req_exec_ckpt_sync_checkpoint_section; + iovecs[0].iov_len = sizeof (req_exec_ckpt_sync_checkpoint_section); +- iovecs[1].iov_base = (char *)checkpoint_section->section_descriptor.section_id.id; ++ iovecs[1].iov_base = checkpoint_section->section_descriptor.section_id.id; + iovecs[1].iov_len = checkpoint_section->section_descriptor.section_id.id_len; + iovecs[2].iov_base = checkpoint_section->section_data; + iovecs[2].iov_len = checkpoint_section->section_descriptor.section_size; +@@ -3529,25 +3568,62 @@ + struct list_head *section_list; + unsigned int res = 0; + +- for (checkpoint_list = checkpoint_list_head.next; ++ /* ++ * iterate through all checkpoints or sections ++ * from the last successfully transmitted checkpoint or sectoin ++ */ ++ for (checkpoint_list = my_iteration_state_checkpoint_list; + checkpoint_list != &checkpoint_list_head; + checkpoint_list = checkpoint_list->next) { + + checkpoint = list_entry (checkpoint_list, struct checkpoint, list); + +- res = sync_checkpoint_transmit (checkpoint); +- if (res != 0) { +- break; ++ /* ++ * Synchronize a checkpoint if there is room in the totem ++ * buffers and we didn't previously synchronize a checkpoint ++ */ ++ if (my_iteration_state == ITERATION_STATE_CHECKPOINT) { ++ res = sync_checkpoint_transmit (checkpoint); ++ if (res != 0) { ++ /* ++ * Couldn't sync this checkpoint keep processing ++ */ ++ return (-1); ++ } ++ my_iteration_state_section_list = checkpoint->sections_list_head.next; ++ my_iteration_state = ITERATION_STATE_SECTION; + } +- for (section_list = checkpoint->sections_list_head.next; ++ ++ /* ++ * Synchronize a checkpoint section if there is room in the ++ * totem buffers ++ */ ++ for (section_list = my_iteration_state_section_list; + section_list != &checkpoint->sections_list_head; + section_list = section_list->next) { + + checkpoint_section = list_entry (section_list, struct checkpoint_section, list); + res = sync_checkpoint_section_transmit (checkpoint, checkpoint_section); ++ if (res != 0) { ++ /* ++ * Couldn't sync this section keep processing ++ */ ++ return (-1); ++ } ++ my_iteration_state_section_list = section_list->next; + } ++ ++ /* ++ * Continue to iterating checkpoints ++ */ ++ my_iteration_state = ITERATION_STATE_CHECKPOINT; ++ my_iteration_state_checkpoint_list = checkpoint_list->next; + } +- return (res); ++ ++ /* ++ * all checkpoints and sections iterated ++ */ ++ return (0); + } + + unsigned int sync_refcounts_iterate (void) +@@ -3556,7 +3632,7 @@ + struct list_head *list; + unsigned int res = 0; + +- for (list = checkpoint_list_head.next; ++ for (list = my_iteration_state_checkpoint_list; + list != &checkpoint_list_head; + list = list->next) { + +@@ -3566,48 +3642,68 @@ + if (res != 0) { + break; + } ++ my_iteration_state_checkpoint_list = list->next; + } + return (res); + } + + static int ckpt_sync_process (void) + { +- unsigned int done_queueing = 1; +- unsigned int continue_processing = 0; ++ unsigned int done_queueing; ++ unsigned int continue_processing; + unsigned int res; + + ENTER(); + ++ continue_processing = 0; ++ + switch (my_sync_state) { ++ case SYNC_STATE_GLOBALID: ++ done_queueing = 1; ++ continue_processing = 1; ++ if (my_should_sync) { ++ res = sync_checkpoint_globalid_transmit (); ++ if (res != 0) { ++ done_queueing = 0; ++ } ++ } ++ if (done_queueing) { ++ sync_checkpoints_enter (); ++ } ++ break; ++ + case SYNC_STATE_CHECKPOINT: +- if (my_lowest_nodeid == api->totem_nodeid_get ()) { ++ done_queueing = 1; ++ continue_processing = 1; ++ ++ if (my_should_sync) { + TRACE1 ("should transmit checkpoints because lowest member in old configuration.\n"); + res = sync_checkpoints_iterate (); + +- if (res == 0) { +- done_queueing = 1; ++ /* ++ * Not done iterating checkpoints ++ */ ++ if (res != 0) { ++ done_queueing = 0; + } + } + if (done_queueing) { + sync_refcounts_enter (); + } +- +- /* +- * TODO recover current iteration state +- */ +- continue_processing = 1; + break; + + case SYNC_STATE_REFCOUNT: +- done_queueing = 1; +- if (my_lowest_nodeid == api->totem_nodeid_get()) { ++ if (my_should_sync) { + TRACE1 ("transmit refcounts because this processor is the lowest member in old configuration.\n"); + res = sync_refcounts_iterate (); +- } +- if (done_queueing) { +- continue_processing = 0; ++ if (res != 0) { ++ continue_processing = 1; ++ } + } + break; ++ ++ default: ++ assert (0); + } + + LEAVE(); +@@ -3628,7 +3724,7 @@ + + list_init (&sync_checkpoint_list_head); + +- my_sync_state = SYNC_STATE_CHECKPOINT; ++ my_sync_state = SYNC_STATE_NOT_STARTED; + + LEAVE(); + } +@@ -3656,6 +3752,22 @@ + return; + } + ++ /* ++ * Discard checkpoints that are used to synchronize the global_ckpt_id ++ * also setting the global ckpt_id as well. ++ */ ++ if (memcmp (&req_exec_ckpt_sync_checkpoint->checkpoint_name.value, ++ GLOBALID_CHECKPOINT_NAME, ++ req_exec_ckpt_sync_checkpoint->checkpoint_name.length) == 0) { ++ ++ if (req_exec_ckpt_sync_checkpoint->ckpt_id >= global_ckpt_id) { ++ global_ckpt_id = req_exec_ckpt_sync_checkpoint->ckpt_id + 1; ++ } ++ ++ LEAVE(); ++ return; ++ } ++ + checkpoint = checkpoint_find_specific ( + &sync_checkpoint_list_head, + &req_exec_ckpt_sync_checkpoint->checkpoint_name, +@@ -3758,7 +3870,7 @@ + corosync_fatal_error (COROSYNC_OUT_OF_MEMORY); + } + if (req_exec_ckpt_sync_checkpoint_section->id_len) { +- ++ + section_id = malloc (req_exec_ckpt_sync_checkpoint_section->id_len + 1); + if (section_id == 0) { + free (checkpoint_section); +@@ -3786,7 +3898,7 @@ + */ + section_id = NULL; + } +- ++ + memcpy (section_contents, + ((char *)req_exec_ckpt_sync_checkpoint_section) + + sizeof (struct req_exec_ckpt_sync_checkpoint_section) + +@@ -3879,52 +3991,3 @@ + + LEAVE(); + } +- +- +-static void ckpt_dump_fn (void) +-{ +- struct list_head *checkpoint_list; +- struct checkpoint *checkpoint; +- struct list_head *checkpoint_section_list; +- struct checkpoint_section *section; +- +- log_printf (LOG_LEVEL_NOTICE, +- "========== Checkpoint Information ==========="); +- log_printf (LOG_LEVEL_NOTICE, "global_ckpt_id: %u", global_ckpt_id); +- +- for (checkpoint_list = checkpoint_list_head.next; +- checkpoint_list != &checkpoint_list_head; +- checkpoint_list = checkpoint_list->next) { +- +- checkpoint = list_entry (checkpoint_list, struct checkpoint, list); +- +- if (checkpoint == NULL) { +- return; +- } +- +- log_printf (LOG_LEVEL_NOTICE, "Checkpoint %s (%d):", +- checkpoint->name.value, checkpoint->name.length); +- log_printf (LOG_LEVEL_NOTICE, " id: %u", checkpoint->ckpt_id); +- log_printf (LOG_LEVEL_NOTICE, " sec cnt: %u", checkpoint->section_count); +- log_printf (LOG_LEVEL_NOTICE, " ref cnt: %u", checkpoint->reference_count); +- log_printf (LOG_LEVEL_NOTICE, " unlinked: %u", checkpoint->unlinked); +- +- for (checkpoint_section_list = checkpoint->sections_list_head.next; +- checkpoint_section_list != &checkpoint->sections_list_head; +- checkpoint_section_list = checkpoint_section_list->next) { +- +- section = list_entry (checkpoint_section_list, +- struct checkpoint_section, list); +- +- log_printf (LOG_LEVEL_NOTICE, " Section %s (%d)", +- section->section_descriptor.section_id.id, +- section->section_descriptor.section_id.id_len); +- log_printf (LOG_LEVEL_NOTICE, " size: %llu", +- section->section_descriptor.section_size); +- log_printf (LOG_LEVEL_NOTICE, " state: %u", +- section->section_descriptor.section_state); +- log_printf (LOG_LEVEL_NOTICE, " exp time: %llu", +- section->section_descriptor.expiration_time); +- } +- } +-} --- openais-0.91.orig/debian/patches/100_makefile.dpatch +++ openais-0.91/debian/patches/100_makefile.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 002_makefile.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad openais-0.90~/Makefile openais-0.90/Makefile +--- openais-0.90~/Makefile 2008-07-24 14:28:11.000000000 +0200 ++++ openais-0.90/Makefile 2008-08-05 10:51:40.000000000 +0200 +@@ -55,22 +55,7 @@ + INCLUDEDIR=$(PREFIX)/include/openais + MANDIR=$(PREFIX)/share/man + ETCDIR=/etc +-ARCH=$(shell uname -p) +- +-ifeq (,$(findstring 64,$(ARCH))) +-LIBDIR=$(PREFIX)/lib/openais +-else +-LIBDIR=$(PREFIX)/lib64/openais +-endif +-ifeq (s390,$(ARCH)) +-LIBDIR=$(PREFIX)/lib/openais +-endif +-ifeq (s390x,$(ARCH)) +-LIBDIR=$(PREFIX)/lib64/openais +-endif +-ifeq (ia64,$(ARCH)) +-LIBDIR=$(PREFIX)/lib/openais +-endif ++LIBDIR=/usr/lib/openais + + SUBDIRS:=$(builddir)lcr $(builddir)lib $(builddir)exec $(builddir)test + sub_make = srcdir=$(srcdir) builddir=$(builddir) subdir=$(1)/ $(MAKE) -I$(srcdir)$(1) -f $(srcdir)$(1)/Makefile $(2) +@@ -149,7 +134,7 @@ + ) \ + done + +- echo $(LIBDIR) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/openais-$(ARCH).conf" ++ echo $(LIBDIR) > "$(DESTDIR)$(ETCDIR)/ld.so.conf.d/openais.conf" + + install -m 755 $(builddir)services/*lcrso $(DESTDIR)$(LCRSODIR) + +diff -urNad openais-0.90~/Makefile.inc openais-0.90/Makefile.inc +--- openais-0.90~/Makefile.inc 2008-07-24 14:28:11.000000000 +0200 ++++ openais-0.90/Makefile.inc 2008-08-05 10:51:40.000000000 +0200 +@@ -1,7 +1,7 @@ + # Common options + PREFIX=/usr + DESTDIR= +-LCRSODIR=$(PREFIX)/libexec/lcrso ++LCRSODIR=/usr/lib/lcrso + + # Do not modify below this line + --- openais-0.91.orig/debian/patches/000_trunk.dpatch +++ openais-0.91/debian/patches/000_trunk.dpatch @@ -0,0 +1,2685 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 000_trunk.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad openais-0.91~/include/mar_clm.h openais-0.91/include/mar_clm.h +--- openais-0.91~/include/mar_clm.h 2008-08-14 17:00:36.000000000 +0200 ++++ openais-0.91/include/mar_clm.h 2009-01-27 07:29:39.000000000 +0100 +@@ -39,6 +39,7 @@ + #include + #include "saAis.h" + #include "saClm.h" ++#include "mar_sa.h" + #include + + #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 -urNad openais-0.91~/include/mar_sa.h openais-0.91/include/mar_sa.h +--- openais-0.91~/include/mar_sa.h 1970-01-01 01:00:00.000000000 +0100 ++++ openais-0.91/include/mar_sa.h 2009-01-27 07:29:39.000000000 +0100 +@@ -0,0 +1,55 @@ ++/* ++ * Copyright 2008, Allied Telesis Labs, New Zealand ++ * ++ * All rights reserved. ++ * ++ * Author: Angus Salkeld (ahsalkeld@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 -urNad openais-0.91~/lib/Makefile openais-0.91/lib/Makefile +--- openais-0.91~/lib/Makefile 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/lib/Makefile 2009-01-27 07:29:39.000000000 +0100 +@@ -40,7 +40,7 @@ + + all: libSaClm.a libSaClm.so.2.0.0 \ + libSaCkpt.a libSaCkpt.so.2.0.0 \ +- libSaAmf.so.2.0.0 \ ++ libSaAmf.a libSaAmf.so.2.0.0 \ + libSaEvt.a libSaEvt.so.2.0.0 \ + libSaMsg.a libSaMsg.so.2.0.0 \ + libSaLck.a libSaLck.so.2.0.0 +@@ -52,6 +52,9 @@ + + DARWIN_OPTS=-dynamiclib -bind_at_load -current_version 2.0.0 -compatibility_version 2.0.0 + ++libSaAmf.so.2.0.0: util.o amf.o ++ $(CC) $(DARWIN_OPTS) util.o amf.o -o $@ ++ + libSaClm.so.2.0.0: util.o clm.o + $(CC) $(DARWIN_OPTS) util.o clm.o -o $@ + +@@ -59,7 +62,7 @@ + $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o ckpt.o -o $@ + + libSaEvt.so.2.0.0: util.o evt.o +- $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o evt.o ++ $(CC) $(LDFLAGS) $(DARWIN_OPTS) util.o evt.o -o $@ + + libSaMsg.so.2.0.0: util.o msg.o + $(CC) $(DARWIN_OPTS) util.o msg.o -o $@ +@@ -89,6 +92,9 @@ + + endif + ++libSaAmf.a: util.o amf.o ++ $(AR) -rc libSaAmf.a util.o amf.o ++ + libSaCkpt.a: util.o ckpt.o + $(AR) -rc libSaCkpt.a util.o ckpt.o + +diff -urNad openais-0.91~/lib/amf.c openais-0.91/lib/amf.c +--- openais-0.91~/lib/amf.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/lib/amf.c 2009-01-27 07:29:39.000000000 +0100 +@@ -49,7 +49,7 @@ + #include + #include + #include +-#include ++#include "util.h" + + + struct res_overlay { +diff -urNad openais-0.91~/lib/ckpt.c openais-0.91/lib/ckpt.c +--- openais-0.91~/lib/ckpt.c 2008-07-24 15:20:09.000000000 +0200 ++++ openais-0.91/lib/ckpt.c 2009-01-27 07:29:39.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 ++#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; + +- marshall_to_mar_name_t ( ++ marshall_SaNameT_to_mar_name_t ( + &req_lib_ckpt_sectiondelete.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectiondelete.ckpt_id = +@@ -1201,7 +1202,7 @@ + req_lib_ckpt_sectionexpirationtimeset.id_len = sectionId->idLen; + req_lib_ckpt_sectionexpirationtimeset.expiration_time = expirationTime; + +- marshall_to_mar_name_t (&req_lib_ckpt_sectionexpirationtimeset.checkpoint_name, ++ marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionexpirationtimeset.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectionexpirationtimeset.ckpt_id = + ckptCheckpointInstance->checkpointId; +@@ -1303,7 +1304,7 @@ + req_lib_ckpt_sectioniterationinitialize.header.id = MESSAGE_REQ_CKPT_SECTIONITERATIONINITIALIZE; + req_lib_ckpt_sectioniterationinitialize.sections_chosen = sectionsChosen; + req_lib_ckpt_sectioniterationinitialize.expiration_time = expirationTime; +- marshall_to_mar_name_t ( ++ marshall_SaNameT_to_mar_name_t ( + &req_lib_ckpt_sectioniterationinitialize.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectioniterationinitialize.ckpt_id = +@@ -1331,7 +1332,7 @@ + saHandleInstancePut (&ckptSectionIterationHandleDatabase, *sectionIterationHandle); + saHandleInstancePut (&checkpointHandleDatabase, checkpointHandle); + +- return (error == SA_AIS_OK ? res_lib_ckpt_sectioniterationinitialize.header.error : error); ++ return (res_lib_ckpt_sectioniterationinitialize.header.error); + + error_put_destroy: + saHandleInstancePut (&ckptSectionIterationHandleDatabase, *sectionIterationHandle); +@@ -1461,14 +1462,14 @@ + + saHandleInstancePut (&ckptSectionIterationHandleDatabase, sectionIterationHandle); + +- return (error); ++ return (res_lib_ckpt_sectioniterationfinalize.header.error); + + error_put: + pthread_mutex_unlock (&ckptSectionIterationInstance->response_mutex); + + saHandleInstancePut (&ckptSectionIterationHandleDatabase, sectionIterationHandle); + error_exit: +- return (error == SA_AIS_OK ? res_lib_ckpt_sectioniterationfinalize.header.error : error); ++ return (error); + } + + SaAisErrorT +@@ -1529,7 +1530,7 @@ + req_lib_ckpt_sectionwrite.data_size = ioVector[i].dataSize; + req_lib_ckpt_sectionwrite.id_len = ioVector[i].sectionId.idLen; + +- marshall_to_mar_name_t (&req_lib_ckpt_sectionwrite.checkpoint_name, ++ marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionwrite.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectionwrite.ckpt_id = + ckptCheckpointInstance->checkpointId; +@@ -1623,7 +1624,7 @@ + req_lib_ckpt_sectionoverwrite.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONOVERWRITE; + req_lib_ckpt_sectionoverwrite.id_len = sectionId->idLen; + req_lib_ckpt_sectionoverwrite.data_size = dataSize; +- marshall_to_mar_name_t (&req_lib_ckpt_sectionoverwrite.checkpoint_name, ++ marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionoverwrite.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectionoverwrite.ckpt_id = + ckptCheckpointInstance->checkpointId; +@@ -1701,7 +1702,7 @@ + req_lib_ckpt_sectionread.data_offset = ioVector[i].dataOffset; + req_lib_ckpt_sectionread.data_size = ioVector[i].dataSize; + +- marshall_to_mar_name_t (&req_lib_ckpt_sectionread.checkpoint_name, ++ marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionread.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_sectionread.ckpt_id = + ckptCheckpointInstance->checkpointId; +@@ -1793,7 +1794,7 @@ + + req_lib_ckpt_checkpointsynchronize.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronize); + req_lib_ckpt_checkpointsynchronize.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE; +- marshall_to_mar_name_t (&req_lib_ckpt_checkpointsynchronize.checkpoint_name, ++ marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointsynchronize.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_checkpointsynchronize.ckpt_id = + ckptCheckpointInstance->checkpointId; +@@ -1852,7 +1853,7 @@ + + req_lib_ckpt_checkpointsynchronizeasync.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronizeasync); + req_lib_ckpt_checkpointsynchronizeasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC; +- marshall_to_mar_name_t ( ++ marshall_SaNameT_to_mar_name_t ( + &req_lib_ckpt_checkpointsynchronizeasync.checkpoint_name, + &ckptCheckpointInstance->checkpointName); + req_lib_ckpt_checkpointsynchronizeasync.ckpt_id = +diff -urNad openais-0.91~/lib/evt.c openais-0.91/lib/evt.c +--- openais-0.91~/lib/evt.c 2008-07-24 14:28:11.000000000 +0200 ++++ openais-0.91/lib/evt.c 2009-01-27 07:29:39.000000000 +0100 +@@ -39,9 +39,11 @@ + #include + #include + #include +-#include + #include +-#include "../include/ipc_evt.h" ++#include "ipc_evt.h" ++#include "mar_sa.h" ++#include "../include/saAis.h" ++#include "util.h" + + #define MESSAGE_SIZE_MAX 1024*1024 + +@@ -507,7 +509,7 @@ + edi->edi_pub_time = evt->led_publish_time; + edi->edi_event_data_size = evt->led_user_data_size; + edi->edi_event_id = evt->led_event_id; +- marshall_from_mar_name_t (&edi->edi_pub_name, &evt->led_publisher_name); ++ marshall_mar_name_t_to_SaNameT (&edi->edi_pub_name, &evt->led_publisher_name); + + if (edi->edi_event_data_size) { + edi->edi_event_data = malloc(edi->edi_event_data_size); +@@ -997,7 +999,7 @@ + req.ico_c_handle = *channelHandle; + req.ico_timeout = timeout; + req.ico_open_flag = channelOpenFlags; +- marshall_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName); ++ marshall_SaNameT_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName); + + iov.iov_base = (char *)&req; + iov.iov_len = sizeof(req); +@@ -1223,7 +1225,7 @@ + req.ico_timeout = 0; + req.ico_invocation = invocation; + req.ico_open_flag = channelOpenFlags; +- marshall_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName); ++ marshall_SaNameT_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName); + iov.iov_base = (char *)&req; + iov.iov_len = sizeof(req); + +@@ -1324,7 +1326,7 @@ + */ + req.iuc_head.size = sizeof(req); + req.iuc_head.id = MESSAGE_REQ_EVT_UNLINK_CHANNEL; +- marshall_to_mar_name_t (&req.iuc_channel_name, (SaNameT *)channelName); ++ marshall_SaNameT_to_mar_name_t (&req.iuc_channel_name, (SaNameT *)channelName); + iov.iov_base = (char *)&req; + iov.iov_len = sizeof(req); + +@@ -1999,7 +2001,7 @@ + req->led_retention_time = edi->edi_retention_time; + req->led_publish_time = clustTimeNow(); + req->led_priority = edi->edi_priority; +- marshall_to_mar_name_t (&req->led_publisher_name, &edi->edi_pub_name); ++ marshall_SaNameT_to_mar_name_t (&req->led_publisher_name, &edi->edi_pub_name); + + iov.iov_base = (char *)req; + iov.iov_len = req->led_head.size; +diff -urNad openais-0.91~/lib/lck.c openais-0.91/lib/lck.c +--- openais-0.91~/lib/lck.c 2008-07-24 15:20:09.000000000 +0200 ++++ openais-0.91/lib/lck.c 2009-01-27 07:29:39.000000000 +0100 +@@ -49,7 +49,8 @@ + #include + #include + #include +-#include "../include/ipc_lck.h" ++#include "ipc_lck.h" ++#include "mar_sa.h" + + #include "util.h" + +@@ -671,7 +672,7 @@ + req_lib_lck_resourceopen.header.size = sizeof (struct req_lib_lck_resourceopen); + req_lib_lck_resourceopen.header.id = MESSAGE_REQ_LCK_RESOURCEOPEN; + +- marshall_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, (SaNameT *)lockResourceName); ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, (SaNameT *)lockResourceName); + + memcpy (&lckResourceInstance->lockResourceName, lockResourceName, sizeof(SaNameT)); + req_lib_lck_resourceopen.resourceOpenFlags = resourceOpenFlags; +@@ -759,7 +760,7 @@ + lckResourceInstance->lckResourceHandle = lckResourceHandle; + lckResourceInstance->resourceOpenFlags = resourceOpenFlags; + +- marshall_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, + (SaNameT *)lockResourceName); + memcpy (&lckResourceInstance->lockResourceName, lockResourceName, sizeof (SaNameT)); + req_lib_lck_resourceopen.header.size = sizeof (struct req_lib_lck_resourceopen); +@@ -812,7 +813,7 @@ + + req_lib_lck_resourceclose.header.size = sizeof (struct req_lib_lck_resourceclose); + req_lib_lck_resourceclose.header.id = MESSAGE_REQ_LCK_RESOURCECLOSE; +- marshall_to_mar_name_t (&req_lib_lck_resourceclose.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceclose.lockResourceName, + &lckResourceInstance->lockResourceName); + req_lib_lck_resourceclose.resourceHandle = lckResourceHandle; + +@@ -880,7 +881,7 @@ + + req_lib_lck_resourcelock.header.size = sizeof (struct req_lib_lck_resourcelock); + req_lib_lck_resourcelock.header.id = MESSAGE_REQ_LCK_RESOURCELOCK; +- marshall_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName, + &lckResourceInstance->lockResourceName); + req_lib_lck_resourcelock.lockMode = lockMode; + req_lib_lck_resourcelock.lockFlags = lockFlags; +@@ -973,7 +974,7 @@ + + req_lib_lck_resourcelock.header.size = sizeof (struct req_lib_lck_resourcelock); + req_lib_lck_resourcelock.header.id = MESSAGE_REQ_LCK_RESOURCELOCKASYNC; +- marshall_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName, + &lckResourceInstance->lockResourceName); + req_lib_lck_resourcelock.lockMode = lockMode; + req_lib_lck_resourcelock.lockFlags = lockFlags; +@@ -1043,7 +1044,7 @@ + return (error); + } + +- marshall_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName, + &lckResourceInstance->lockResourceName); + + saHandleInstancePut (&lckResourceHandleDatabase, +@@ -1101,7 +1102,7 @@ + return (error); + } + +- marshall_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName, + &lckResourceInstance->lockResourceName); + + saHandleInstancePut (&lckResourceHandleDatabase, +@@ -1149,7 +1150,7 @@ + + req_lib_lck_lockpurge.header.size = sizeof (struct req_lib_lck_lockpurge); + req_lib_lck_lockpurge.header.id = MESSAGE_REQ_LCK_LOCKPURGE; +- marshall_to_mar_name_t (&req_lib_lck_lockpurge.lockResourceName, ++ marshall_SaNameT_to_mar_name_t (&req_lib_lck_lockpurge.lockResourceName, + &lckResourceInstance->lockResourceName); + + pthread_mutex_lock (lckResourceInstance->response_mutex); +diff -urNad openais-0.91~/services/Makefile openais-0.91/services/Makefile +--- openais-0.91~/services/Makefile 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/Makefile 2009-01-27 07:29:39.000000000 +0100 +@@ -63,6 +63,8 @@ + + ifeq (${OPENAIS_COMPAT}, DARWIN) + ++COROSYNC_BIN=$(PREFIX)/sbin/corosync ++ + service_evs.lcrso: evs.o + $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader $(COROSYNC_BIN) -bind_at_load evs.o -o $@ + +diff -urNad openais-0.91~/services/amf.c openais-0.91/services/amf.c +--- openais-0.91~/services/amf.c 2008-09-22 22:30:14.000000000 +0200 ++++ openais-0.91/services/amf.c 2009-01-27 07:29:39.000000000 +0100 +@@ -594,7 +594,7 @@ + int i; + amf_node_t *amf_node; + +- ENTER (""); ++ ENTER (); + + if (amf_cluster == NULL) { + return; +@@ -611,7 +611,7 @@ + if (strcmp ((char*)amf_node->saAmfNodeClmNode.value, + clm_node_list[i].hostname) == 0) { + +- dprintf ("%s id set to %u", amf_node->name.value, ++ TRACE1 ("%s id set to %u", amf_node->name.value, + clm_node_list[i].nodeid); + amf_node->nodeid = clm_node_list[i].nodeid; + } +@@ -680,7 +680,7 @@ + res = api->totem_mcast (iov, 2, TOTEM_AGREED); + + if (res != 0) { +- dprintf("Unable to send %d bytes of sync data\n", req_exec.header.size); ++ TRACE1("Unable to send %d bytes of sync data\n", req_exec.header.size); + } + + return res; +@@ -1111,7 +1111,7 @@ + int i; + struct amf_node *node; + +- ENTER (""); ++ ENTER (); + log_printf(LOG_NOTICE, "AMF synchronisation ready, starting cluster"); + + for (i = 0; i < clm_node_list_entries; i++) { +@@ -1150,7 +1150,7 @@ + } + break; + default: +- dprintf ("unknown state: %u", scsm.state);; ++ TRACE1 ("unknown state: %u", scsm.state);; + assert (0); + break; + } +@@ -1287,7 +1287,7 @@ + case NORMAL_OPERATION: + break; + default: +- dprintf ("unknown state: %u", scsm.state);; ++ TRACE1 ("unknown state: %u", scsm.state);; + assert (0); + break; + } +@@ -1338,9 +1338,7 @@ + unsigned int *joined_list, int joined_list_entries, + struct memb_ring_id *ring_id) + { +- ENTER ("mnum: %d, jnum: %d, lnum: %d, sync state: %s, ring ID %llu rep %s\n", +- member_list_entries, joined_list_entries, left_list_entries, +- scsm_state_names[scsm.state], ring_id->seq, api->totem_ip_print (&ring_id->rep)); ++ ENTER (); + + switch (scsm.state) { + case UNCONFIGURED: +@@ -1442,7 +1440,7 @@ + /* Make sure this is not a new connection */ + if (comp != NULL && comp->conn == conn ) { + comp->conn = NULL; +- dprintf ("Lib exit from comp %s\n", getSaNameT (&comp->name)); ++ TRACE1 ("Lib exit from comp %s\n", getSaNameT (&comp->name)); + } + + return (0); +@@ -1571,7 +1569,7 @@ + } + + comp = amf_comp_find (amf_cluster, &req_exec->compName); +- ENTER ("%s",comp->name.value); ++ ENTER (); + + if (comp == NULL) { + log_printf (LOG_ERR, "Error: '%s' not found", req_exec->compName.value); +@@ -1603,7 +1601,7 @@ + return; + } + +- ENTER ("%s", comp->name.value); ++ ENTER (); + + healthcheck = amf_comp_find_healthcheck (comp, &req_exec->safHealthcheckKey); + +@@ -1678,7 +1676,7 @@ + case UNCONFIGURED: + break; + default: +- dprintf ("unknown state %d", scsm.state); ++ TRACE1 ("unknown state %d", scsm.state); + assert (0); + break; + } +@@ -1788,7 +1786,7 @@ + scsm.csi_attribute->name); + break; + default: +- dprintf ("unknown object: %u", req_exec->object_type); ++ TRACE1 ("unknown object: %u", req_exec->object_type); + assert (0); + break; + } +diff -urNad openais-0.91~/services/amfapp.c openais-0.91/services/amfapp.c +--- openais-0.91~/services/amfapp.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfapp.c 2009-01-27 07:29:39.000000000 +0100 +@@ -151,7 +151,7 @@ + amf_node_t *node) + { + application_event_t app_event = {event_type, app, node}; +- ENTER(""); ++ ENTER(); + amf_fifo_put (event_type, &app->deferred_events, + sizeof (application_event_t), &app_event); + } +@@ -189,7 +189,7 @@ + { + amf_application_t *app = (amf_application_t*)data; + +- ENTER (""); ++ ENTER (); + application_recall_deferred_events (app); + } + +@@ -239,14 +239,14 @@ + + static void timer_function_cluster_application_started (void* app) + { +- ENTER(""); ++ ENTER(); + amf_application_t *application = (amf_application_t*)app; + amf_cluster_application_started (application->cluster, application); + } + + static void timer_function_node_application_started (void* app) + { +- ENTER(""); ++ ENTER(); + amf_application_t *application = (amf_application_t*)app; + amf_node_application_started (application->node_to_start, application); + } +@@ -258,7 +258,7 @@ + int su_to_instantiate = 0; + app->node_to_start = node; + app->acsm_state = APP_AC_STARTING_SGS; +- ENTER ("%s",app->name.value); ++ ENTER (); + for (sg = app->sg_head; sg != NULL; sg = sg->next) { + su_to_instantiate += amf_sg_start (sg, node); + } +@@ -279,7 +279,7 @@ + { + amf_sg_t *sg = 0; + int posible_to_assign_si = 0; +- ENTER ("%s",app->name.value); ++ ENTER (); + app->acsm_state = APP_AC_ASSIGNING_WORKLOAD; + for (sg = app->sg_head; sg != NULL; sg = sg->next) { + if (amf_sg_assign_si_req (sg, 0)) { +@@ -294,7 +294,7 @@ + + static void application_enter_workload_assigned (amf_application_t *app) + { +- ENTER ("%s", app->name.value); ++ ENTER (); + if (all_sg_assigned (app)){ + app->acsm_state = APP_AC_WORKLOAD_ASSIGNED; + if (app->node_to_start == NULL){ +@@ -319,7 +319,7 @@ + void amf_application_start ( + struct amf_application *app, struct amf_node *node) + { +- ENTER ("'%s'", app->name.value); ++ ENTER (); + assert (app != NULL); + switch (app->acsm_state) { + case APP_AC_UNINSTANTIATED: +@@ -365,7 +365,7 @@ + + assert (app != NULL); + app->node_to_start = node; +- ENTER("app->acsm_state = %d",app->acsm_state); ++ ENTER(); + + switch (app->acsm_state) { + case APP_AC_STARTING_SGS: +@@ -398,7 +398,7 @@ + /* + * Calling object has violated the contract ! + */ +- dprintf ("acsm_state = %d",app->acsm_state); ++ TRACE1 ("acsm_state = %d",app->acsm_state); + assert (0); + break; + } +@@ -411,7 +411,7 @@ + void amf_application_sg_started (struct amf_application *app, struct amf_sg *sg, + struct amf_node *node) + { +- ENTER ("'%s %s'", app->name.value, sg->name.value); ++ ENTER (); + + assert (app != NULL); + +@@ -437,7 +437,7 @@ + void amf_application_sg_assigned ( + struct amf_application *app, struct amf_sg *sg) + { +- ENTER ("'%s'", app->name.value); ++ ENTER (); + assert (app != NULL); + + switch (app->acsm_state) { +@@ -543,7 +543,7 @@ + } + + if (app == NULL) { +- dprintf ("App %s not found!", name); ++ TRACE1 ("App %s not found!", name); + } + return app; + } +diff -urNad openais-0.91~/services/amfcluster.c openais-0.91/services/amfcluster.c +--- openais-0.91~/services/amfcluster.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfcluster.c 2009-01-27 07:29:39.000000000 +0100 +@@ -195,7 +195,7 @@ + { + amf_cluster_t *cluster = (amf_cluster_t*)data; + +- ENTER (""); ++ ENTER (); + cluster_recall_deferred_events (cluster); + } + +@@ -260,7 +260,7 @@ + static void amf_cluster_assign_workload (struct amf_cluster *cluster) + { + struct amf_application *app; +- ENTER (""); ++ ENTER (); + + for (app = cluster->application_head; app != NULL; app = app->next) { + amf_application_assign_workload (app, NULL); +@@ -279,7 +279,7 @@ + { + ((struct amf_cluster*)cluster)->timeout_handle = 0; + +- ENTER (""); ++ ENTER (); + + amf_msg_mcast (MESSAGE_REQ_EXEC_AMF_CLUSTER_START_TMO, &this_amf_node->name, + sizeof(SaNameT)); +@@ -288,7 +288,7 @@ + static inline void stop_cluster_startup_timer (struct amf_cluster *cluster) + { + if (cluster->timeout_handle) { +- dprintf ("Stop cluster startup timer"); ++ TRACE1 ("Stop cluster startup timer"); + api->timer_delete (cluster->timeout_handle); + cluster->timeout_handle = 0; + } +@@ -308,7 +308,7 @@ + static inline void cluster_enter_starting_applications ( + struct amf_cluster *cluster) + { +- ENTER (""); ++ ENTER (); + start_cluster_startup_timer (cluster); + amf_cluster->acsm_state = CLUSTER_AC_STARTING_APPLICATIONS; + amf_cluster_start_applications (cluster); +@@ -316,7 +316,7 @@ + + static void acsm_cluster_enter_started (amf_cluster_t *cluster) + { +- ENTER (""); ++ ENTER (); + amf_cluster->acsm_state = CLUSTER_AC_STARTED; + amf_call_function_asynchronous ( + timer_function_cluster_recall_deferred_events, cluster); +@@ -329,19 +329,19 @@ + void amf_cluster_start_tmo_event (int is_sync_masterm, + struct amf_cluster *cluster, SaNameT *sourceNodeName) + { +- ENTER ("acsm_state = %d", amf_cluster->acsm_state); ++ ENTER (); + + stop_cluster_startup_timer (cluster); + + switch (cluster->acsm_state) { + case CLUSTER_AC_WAITING_OVER_TIME_1: + if (cluster_applications_are_starting_sgs (cluster)) { +- dprintf ("Cluster startup timeout," ++ TRACE1 ("Cluster startup timeout," + "start waiting over time"); + amf_cluster->acsm_state = + CLUSTER_AC_WAITING_OVER_TIME_2; + } else { +- dprintf ("Cluster startup timeout," ++ TRACE1 ("Cluster startup timeout," + " assigning workload"); + acsm_cluster_enter_assigning_workload (cluster); + } +@@ -392,7 +392,7 @@ + */ + void amf_cluster_sync_ready (struct amf_cluster *cluster, struct amf_node *node) + { +- ENTER (""); ++ ENTER (); + switch (amf_cluster->acsm_state) { + case CLUSTER_AC_UNINSTANTIATED: + if (amf_cluster->saAmfClusterAdminState == +@@ -448,8 +448,7 @@ + void amf_cluster_application_started ( + struct amf_cluster *cluster, struct amf_application *application) + { +- ENTER ("application '%s' started %d", application->name.value, +- cluster->acsm_state); ++ ENTER (); + switch (cluster->acsm_state) { + case CLUSTER_AC_STARTING_APPLICATIONS: + if (cluster_applications_started_instantiated (cluster)) { +@@ -479,7 +478,7 @@ + void amf_cluster_application_workload_assigned ( + struct amf_cluster *cluster, struct amf_application *app) + { +- ENTER (""); ++ ENTER (); + switch (cluster->acsm_state) { + case CLUSTER_AC_ASSIGNING_WORKLOAD: + log_printf (LOG_NOTICE, "Cluster: application %s assigned.", +diff -urNad openais-0.91~/services/amfcomp.c openais-0.91/services/amfcomp.c +--- openais-0.91~/services/amfcomp.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfcomp.c 2009-01-27 07:29:39.000000000 +0100 +@@ -319,8 +319,7 @@ + struct amf_comp *comp, + SaAmfRecommendedRecoveryT recommended_recovery) + { +- ENTER ("%s, recommended_recovery = %d", +- comp->name.value, recommended_recovery); ++ ENTER (); + amf_comp_error_suspected_set (comp); + comp_recover_action (comp, recommended_recovery); + } +@@ -348,7 +347,7 @@ + int argv_size; + int envp_size; + +- ENTER_VOID(); ++ ENTER(); + + pid = fork(); + +@@ -512,7 +511,7 @@ + + static void start_component_instantiate_timer (struct amf_comp *component) + { +- ENTER("%s",component->name.value); ++ ENTER(); + if (component->instantiate_timeout_handle == 0) { + api->timer_add_duration ( + component->saAmfCompInstantiateTimeout * MILLI_2_NANO_SECONDS, +@@ -524,7 +523,7 @@ + + static void start_component_cleanup_timer (struct amf_comp *component) + { +- ENTER("%s",component->name.value); ++ ENTER(); + if (component->cleanup_timeout_handle == 0) { + api->timer_add_duration ( + component->saAmfCompCleanupTimeout * MILLI_2_NANO_SECONDS, +@@ -536,7 +535,7 @@ + + void stop_component_cleanup_timer (struct amf_comp *component) + { +- ENTER("%s",component->name.value); ++ ENTER(); + + if (component->cleanup_timeout_handle != 0) { + api->timer_delete ( +@@ -556,7 +555,7 @@ + + struct clc_command_run_data *clc_command_run_data; + +- ENTER("comp '%s'\n", getSaNameT (&comp->name)); ++ ENTER(); + + clc_command_run_data = amf_malloc (sizeof (struct clc_command_run_data)); + clc_command_run_data->comp = comp; +@@ -575,13 +574,13 @@ + + static int clc_instantiate_callback (struct amf_comp *comp) + { +- ENTER("comp %s\n", getSaNameT (&comp->name)); ++ ENTER(); + return (0); + } + + static int clc_csi_set_callback (struct amf_comp *comp) + { +- ENTER("comp %s\n", getSaNameT (&comp->name)); ++ ENTER(); + return (0); + } + +@@ -590,7 +589,7 @@ + */ + static int clc_cli_terminate (struct amf_comp *comp) + { +- ENTER("comp %s\n", getSaNameT (&comp->name)); ++ ENTER(); + return (0); + } + +@@ -605,7 +604,7 @@ + struct res_lib_amf_componentterminatecallback res_lib; + struct component_terminate_callback_data *component_terminate_callback_data; + +- ENTER("comp %s\n", getSaNameT (&comp->name)); ++ ENTER(); + + res_lib.header.id = MESSAGE_RES_AMF_COMPONENTTERMINATECALLBACK; + res_lib.header.size = sizeof (struct res_lib_amf_componentterminatecallback); +@@ -632,7 +631,7 @@ + + static int clc_csi_remove_callback (struct amf_comp *comp) + { +- dprintf ("clc_tcsi_remove_callback\n"); ++ TRACE1 ("clc_tcsi_remove_callback\n"); + return (0); + } + +@@ -672,7 +671,7 @@ + + struct clc_command_run_data *clc_command_run_data; + +- dprintf ("clc_cli_cleanup\n"); ++ TRACE1 ("clc_cli_cleanup\n"); + clc_command_run_data = amf_malloc (sizeof (struct clc_command_run_data)); + clc_command_run_data->comp = comp; + clc_command_run_data->type = CLC_COMMAND_RUN_OPERATION_TYPE_CLEANUP; +@@ -691,7 +690,7 @@ + + static int clc_cli_cleanup_local (struct amf_comp *comp) + { +- dprintf ("clc_cli_cleanup_local\n"); ++ TRACE1 ("clc_cli_cleanup_local\n"); + return (0); + } + +@@ -700,7 +699,7 @@ + { + int res; + +- dprintf ("clc terminate for comp %s\n", getSaNameT (&comp->name)); ++ TRACE1 ("clc terminate for comp %s\n", getSaNameT (&comp->name)); + assert (0); + comp_presence_state_set (comp, SA_AMF_PRESENCE_TERMINATING); + operational_state_comp_set (comp, SA_AMF_OPERATIONAL_DISABLED); +@@ -912,7 +911,7 @@ + if (!amf_su_is_local (comp->su)) + return; + +- ENTER ("'%s'\n", getSaNameT (&comp->name)); ++ ENTER (); + + for (healthcheck = comp->healthcheck_head; + healthcheck != NULL; +@@ -1048,7 +1047,7 @@ + static void healthcheck_deactivate ( + struct amf_healthcheck *healthcheck_active) + { +- dprintf ("deactivating healthcheck for component %s\n", ++ TRACE1 ("deactivating healthcheck for component %s\n", + getSaNameT (&healthcheck_active->comp->name)); + + api->timer_delete (healthcheck_active->timer_handle_period); +@@ -1168,11 +1167,7 @@ + + csi = csi_assignment->csi; + +- ENTER ("Assigning CSI '%s' state %s to comp '%s'\n", +- getSaNameT (&csi->name), +- amf_ha_state (csi_assignment->requested_ha_state), +- comp->name.value); +- ++ ENTER (); + for (attribute = csi->attributes_head; + attribute != NULL; + attribute = attribute->next) { +@@ -1254,10 +1249,10 @@ + + static void stop_component_instantiate_timer (struct amf_comp *component) + { +- ENTER("%s",component->name.value); ++ ENTER(); + + if (component->instantiate_timeout_handle) { +- dprintf ("Stop component instantiate timer"); ++ TRACE1 ("Stop component instantiate timer"); + api->timer_delete (component->instantiate_timeout_handle); + component->instantiate_timeout_handle = 0; + } +@@ -1330,7 +1325,7 @@ + static void clear_ha_state ( + struct amf_comp *comp, struct amf_csi_assignment *csi_assignment) + { +- ENTER (""); ++ ENTER (); + csi_assignment->saAmfCSICompHAState = 0; + } + +@@ -1340,8 +1335,7 @@ + { + + +- ENTER ("%s %d %d", comp->name.value,recommendedRecovery, +- comp->saAmfCompRecoveryOnError); ++ ENTER (); + + amf_node_t *node = amf_node_find (&comp->su->saAmfSUHostedByNode); + switch (recommendedRecovery) { +@@ -1389,7 +1383,7 @@ + break; + case SA_AMF_APPLICATION_RESTART: + default: +- dprintf("recommendedRecovery=%d",recommendedRecovery); ++ TRACE1("recommendedRecovery=%d",recommendedRecovery); + assert (0); + break; + } +@@ -1430,7 +1424,7 @@ + */ + void amf_comp_cleanup_failed_completed (amf_comp_t *comp) + { +- ENTER ("'%s'", comp->name.value); ++ ENTER (); + + stop_component_cleanup_timer (comp); + amf_comp_error_suspected_clear (comp); +@@ -1564,6 +1558,7 @@ + + pm = amf_calloc(1, sizeof(struct amf_pm)); + if ( pm == NULL ) { ++ fclose (p); + return; + } + +@@ -1755,7 +1750,7 @@ + goto error_exit; + } + +- dprintf ("Healthcheckstart: '%s', key '%s'", ++ TRACE1 ("Healthcheckstart: '%s', key '%s'", + comp->name.value, healthcheckKey->key); + + /* +@@ -1811,7 +1806,7 @@ + struct amf_healthcheck *healthcheck; + SaAisErrorT error = SA_AIS_OK; + +- dprintf ("Healthcheckstop: '%s'", comp->name.value); ++ TRACE1 ("Healthcheckstop: '%s'", comp->name.value); + + if (!amf_su_is_local (comp->su)) { + return SA_AIS_OK; +@@ -1843,8 +1838,7 @@ + */ + void amf_comp_instantiate (struct amf_comp *comp) + { +- ENTER ("'%s' SU '%s'", getSaNameT (&comp->name), +- getSaNameT (&comp->su->name)); ++ ENTER (); + + switch (comp->saAmfCompPresenceState) { + case SA_AMF_PRESENCE_RESTARTING: +@@ -1860,7 +1854,7 @@ + } + break; + default: +- dprintf("Instantiate ignored in Component presence state %d", ++ TRACE1("Instantiate ignored in Component presence state %d", + comp->saAmfCompPresenceState); + break; + } +@@ -1868,9 +1862,7 @@ + + void amf_comp_cleanup_tmo_event (struct amf_comp *comp) + { +- ENTER ("Comp cleanup timeout after %d ms '%s' '%s'", +- comp->saAmfCompCleanupTimeout, comp->su->name.value, +- comp->name.value); ++ ENTER (); + amf_comp_error_suspected_clear(comp); + amf_comp_operational_state_set (comp, SA_AMF_OPERATIONAL_DISABLED); + comp_presence_state_set (comp, SA_AMF_PRESENCE_TERMINATION_FAILED); +@@ -1878,9 +1870,7 @@ + + void amf_comp_instantiate_tmo_event (struct amf_comp *comp) + { +- ENTER ("Comp instantiate timeout after %d ms '%s' '%s'", +- comp->saAmfCompInstantiateTimeout, comp->su->name.value, +- comp->name.value); ++ ENTER (); + + switch (comp->saAmfCompPresenceState) { + case SA_AMF_PRESENCE_RESTARTING: +@@ -1897,7 +1887,7 @@ + assert (comp->instantiate_timeout_handle == 0); + break; + default: +- dprintf("Presence state = %d", comp->saAmfCompPresenceState); ++ TRACE1("Presence state = %d", comp->saAmfCompPresenceState); + assert (0); + break; + } +@@ -1906,14 +1896,14 @@ + void amf_comp_instantiate_event (struct amf_comp *component) + { + int res; +- ENTER (""); ++ ENTER (); + switch (component->saAmfCompPresenceState) { + case SA_AMF_PRESENCE_INSTANTIATING: + case SA_AMF_PRESENCE_INSTANTIATED: + case SA_AMF_PRESENCE_TERMINATING: + case SA_AMF_PRESENCE_INSTANTIATION_FAILED: + case SA_AMF_PRESENCE_TERMINATION_FAILED: +- dprintf("Instantiate ignored in Component presence state %d", ++ TRACE1("Instantiate ignored in Component presence state %d", + component->saAmfCompPresenceState); + break; + case SA_AMF_PRESENCE_UNINSTANTIATED: +@@ -1934,7 +1924,7 @@ + } + break; + default: +- dprintf("Component presence state %d", ++ TRACE1("Component presence state %d", + component->saAmfCompPresenceState); + assert (0); + break; +@@ -2033,7 +2023,7 @@ + struct component_terminate_callback_data *component_terminate_callback_data; + component_terminate_callback_data = data; + +- dprintf ("Lib component terminate callback response, error: %d", error); ++ TRACE1 ("Lib component terminate callback response, error: %d", error); + amf_comp_healthcheck_deactivate (component_terminate_callback_data->comp); + escalation_policy_restart (component_terminate_callback_data->comp); + return 1; +@@ -2072,11 +2062,11 @@ + + switch (interface) { + case AMF_RESPONSE_CSISETCALLBACK: { +- ENTER("'%s'", dn->value); ++ ENTER(); + csi_assignment = amf_csi_assignment_find (amf_cluster, dn); + assert (csi_assignment != NULL); + comp = csi_assignment->comp; +- dprintf ("CSI '%s' set callback response from '%s', error: %d", ++ TRACE1 ("CSI '%s' set callback response from '%s', error: %d", + csi_assignment->csi->name.value, + csi_assignment->comp->name.value, error); + comp = csi_assignment->comp; +@@ -2092,10 +2082,10 @@ + break; + } + case AMF_RESPONSE_CSIREMOVECALLBACK: { +- ENTER("'%s'", dn->value); ++ ENTER(); + csi_assignment = amf_csi_assignment_find (amf_cluster, dn); + assert (csi_assignment != NULL); +- dprintf ("Lib csi '%s' remove callback response from '%s', error: %d", ++ TRACE1 ("Lib csi '%s' remove callback response from '%s', error: %d", + csi_assignment->csi->name.value, + csi_assignment->comp->name.value, error); + comp = csi_assignment->comp; +@@ -2108,7 +2098,7 @@ + break; + } + case AMF_RESPONSE_HEALTHCHECKCALLBACK: { +- dprintf("AMF_RESPONSE_HEALTHCHECKCALLBACK for %s", dn->value); ++ TRACE1("AMF_RESPONSE_HEALTHCHECKCALLBACK for %s", dn->value); + comp = amf_comp_find (amf_cluster, dn); + + assert (comp); +@@ -2124,7 +2114,7 @@ + #if 0 + case AMF_RESPONSE_COMPONENTTERMINATECALLBACK: { + struct component_terminate_callback_data *callback_data = data; +- dprintf ("Lib comp '%s' terminate callback response, error: %d", ++ TRACE1 ("Lib comp '%s' terminate callback response, error: %d", + callback_data->comp->name.value, error); + comp_presence_state_set (callback_data->comp, + SA_AMF_PRESENCE_UNINSTANTIATED); +@@ -2149,7 +2139,7 @@ + struct amf_comp *component, + struct amf_csi_assignment *csi_assignment) + { +- ENTER ("'%s'", csi_assignment->csi->name.value); ++ ENTER (); + + assert (component != NULL && csi_assignment != NULL); + +@@ -2160,13 +2150,13 @@ + if (csi_assignment->requested_ha_state == SA_AMF_HA_QUIESCED) { + csi_assignment->saAmfCSICompHAState = csi_assignment->requested_ha_state; + } else { +- dprintf ("csi_assignment->requested_ha_state = %d", ++ TRACE1 ("csi_assignment->requested_ha_state = %d", + component->error_suspected); + assert (0); + } + } + +- LEAVE(""); ++ LEAVE(); + } + + /** +@@ -2175,7 +2165,7 @@ + */ + void amf_comp_terminate (struct amf_comp *comp) + { +- dprintf ("comp terminate '%s'\n", getSaNameT (&comp->name)); ++ TRACE1 ("comp terminate '%s'\n", getSaNameT (&comp->name)); + comp_presence_state_set (comp, SA_AMF_PRESENCE_TERMINATING); + + if (amf_su_is_local (comp->su)) { +@@ -2197,7 +2187,7 @@ + */ + void amf_comp_restart (struct amf_comp *comp) + { +- dprintf ("comp restart '%s'\n", getSaNameT (&comp->name)); ++ TRACE1 ("comp restart '%s'\n", getSaNameT (&comp->name)); + comp_presence_state_set (comp, SA_AMF_PRESENCE_RESTARTING); + comp->saAmfCompRestartCount += 1; + +@@ -2223,7 +2213,7 @@ + + assert (comp != NULL && csi_name != NULL && ha_state != NULL); + +- dprintf ("comp ha state get from comp '%s' CSI '%s'\n", ++ TRACE1 ("comp ha state get from comp '%s' CSI '%s'\n", + getSaNameT (&comp->name), csi_name->value); + + assignment = csi_assignment_find_in (comp, csi_name); +@@ -2366,7 +2356,8 @@ + int change_pending = 0; + struct amf_csi_assignment *csi_assignment; + +- ENTER("saAmfCompPresenceState = %d", component->saAmfCompPresenceState); ++ ENTER(); ++ + amf_comp_error_suspected_clear (component); + if (component->saAmfCompPresenceState == SA_AMF_PRESENCE_INSTANTIATING || + component->saAmfCompPresenceState == SA_AMF_PRESENCE_RESTARTING || +@@ -2713,7 +2704,7 @@ + { + struct res_lib_amf_csiremovecallback res_lib; + +- ENTER(""); ++ ENTER(); + + res_lib.header.id = MESSAGE_RES_AMF_CSIREMOVECALLBACK; + res_lib.header.size = sizeof (struct res_lib_amf_csiremovecallback); +diff -urNad openais-0.91~/services/amfnode.c openais-0.91/services/amfnode.c +--- openais-0.91~/services/amfnode.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfnode.c 2009-01-27 07:29:39.000000000 +0100 +@@ -203,7 +203,7 @@ + + static void node_acsm_enter_leaving_spontaneously(struct amf_node *node) + { +- ENTER("'%s'", node->name.value); ++ ENTER(); + node->saAmfNodeOperState = SA_AMF_OPERATIONAL_DISABLED; + node->nodeid = 0; + } +@@ -215,7 +215,7 @@ + struct amf_su *su; + struct amf_comp *component = NULL; + +- ENTER("'%s'", node->name.value); ++ ENTER(); + node->acsm_state = NODE_ACSM_LEAVING_SPONTANEOUSLY_FAILING_OVER; + /* + * Indicate to each component object in the model that current +@@ -267,7 +267,7 @@ + + static void node_acsm_enter_failing_gracefully_failing_over (amf_node_t *node) + { +- ENTER("%s", node->name.value); ++ ENTER(); + node->acsm_state = NODE_ACSM_FAILING_GRACEFULLY_FAILING_OVER; + failover_all_sg_on_node (node); + } +@@ -301,7 +301,7 @@ + + static void repair_node (amf_node_t *node) + { +- ENTER(""); ++ ENTER(); + char hostname[256]; + gethostname (hostname, 256); + if (!strcmp (hostname, (const char*)node->saAmfNodeClmNode.value)) { +@@ -316,14 +316,14 @@ + + static void enter_failing_gracefully_rebooting_node (amf_node_t *node) + { +- ENTER(""); ++ ENTER(); + node->acsm_state = NODE_ACSM_FAILING_GRACEFULLY_REBOOTING_NODE; + repair_node (node); + } + + static void node_acsm_enter_idle (amf_node_t *node) + { +- ENTER ("history_state=%d",node->history_state); ++ ENTER (); + node->acsm_state = node->history_state; + } + +@@ -334,7 +334,7 @@ + "Node=%s: all applications started, assigning workload.", + node->name.value); + +- ENTER(""); ++ ENTER(); + node->acsm_state = NODE_ACSM_JOINING_ASSIGNING_WORKLOAD; + for (app = app->cluster->application_head; app != NULL; + app = app->next) { +@@ -355,9 +355,7 @@ + void amf_node_leave (struct amf_node *node) + { + assert (node != NULL); +- ENTER("'%s', CLM node '%s'", node->name.value, +- node->saAmfNodeClmNode.value); +- ++ ENTER(); + + switch (node->acsm_state) { + case NODE_ACSM_IDLE_ESCALLATION_LEVEL_0: +@@ -389,8 +387,7 @@ + void amf_node_failover (struct amf_node *node) + { + assert (node != NULL); +- ENTER("'%s', CLM node '%s'", node->name.value, +- node->saAmfNodeClmNode.value); ++ ENTER(); + + switch (node->acsm_state) { + case NODE_ACSM_IDLE_ESCALLATION_LEVEL_0: +@@ -438,7 +435,7 @@ + void amf_node_comp_restart_req (struct amf_node *node, struct amf_comp *comp) + { + amf_su_t *su = comp->su; +- ENTER(""); ++ ENTER(); + switch (node->acsm_state) { + case NODE_ACSM_IDLE_ESCALLATION_LEVEL_0: + node->acsm_state = NODE_ACSM_IDLE_ESCALLATION_LEVEL_2; +@@ -478,7 +475,7 @@ + } + break; + default: +- dprintf("%d",node->acsm_state); ++ TRACE1("%d",node->acsm_state); + assert (0); + break; + } +@@ -494,7 +491,7 @@ + */ + void amf_node_comp_failover_req (amf_node_t *node, amf_comp_t *comp) + { +- ENTER(""); ++ ENTER(); + switch (node->acsm_state) { + case NODE_ACSM_IDLE_ESCALLATION_LEVEL_0: + case NODE_ACSM_IDLE_ESCALLATION_LEVEL_2: +@@ -516,7 +513,7 @@ + } + break; + default: +- dprintf("%d",node->acsm_state); ++ TRACE1("%d",node->acsm_state); + assert (0); + break; + } +@@ -578,8 +575,7 @@ + struct amf_application *app) + { + assert (node != NULL && app != NULL ); +- ENTER ("Node=%s: application '%s' started", node->name.value, +- app->name.value); ++ ENTER (); + + switch (node->acsm_state) { + case NODE_ACSM_JOINING_STARTING_APPLICATIONS: +@@ -608,8 +604,7 @@ + struct amf_application *app) + { + assert (node != NULL && app != NULL ); +- ENTER ("Node=%s: application '%s' started", node->name.value, +- app->name.value); ++ ENTER (); + + switch (node->acsm_state) { + case NODE_ACSM_JOINING_ASSIGNING_WORKLOAD: +@@ -638,8 +633,7 @@ + void amf_node_sg_failed_over (struct amf_node *node, struct amf_sg *sg_in) + { + assert (node != NULL); +- ENTER ("Node=%s: SG '%s' started %d", node->name.value, +- sg_in->name.value,node->acsm_state); ++ ENTER (); + + switch (node->acsm_state) { + case NODE_ACSM_LEAVING_SPONTANEOUSLY_FAILING_OVER: +@@ -756,7 +750,7 @@ + } + } + +- dprintf ("node %s not found in configuration!", name->value); ++ TRACE1 ("node %s not found in configuration!", name->value); + + return NULL; + } +@@ -772,7 +766,7 @@ + } + } + +- dprintf ("node %u not found in configuration!", nodeid); ++ TRACE1 ("node %u not found in configuration!", nodeid); + + return NULL; + } +@@ -788,7 +782,7 @@ + } + } + +- dprintf ("node %s not found in configuration!", hostname); ++ TRACE1 ("node %s not found in configuration!", hostname); + + return NULL; + } +diff -urNad openais-0.91~/services/amfsg.c openais-0.91/services/amfsg.c +--- openais-0.91~/services/amfsg.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfsg.c 2009-01-27 07:29:39.000000000 +0100 +@@ -429,7 +429,7 @@ + static void sg_defer_event (amf_sg_event_type_t event_type, + sg_event_t *sg_event) + { +- ENTER("Defered event = %d", event_type); ++ ENTER(); + amf_fifo_put (event_type, &sg_event->sg->deferred_events, + sizeof (sg_event_t), + sg_event); +@@ -439,7 +439,7 @@ + { + sg_event_t sg_event; + +- ENTER ("%s", sg->name.value); ++ ENTER (); + if (amf_fifo_get (&sg->deferred_events, &sg_event)) { + switch (sg_event.event_type) { + case SG_FAILOVER_SU_EV: +@@ -455,7 +455,7 @@ + case SG_START_EV: + case SG_AUTO_ADJUST_EV: + default: +- dprintf("event_type = %d", sg_event.event_type); ++ TRACE1("event_type = %d", sg_event.event_type); + break; + } + } +@@ -464,7 +464,7 @@ + static void timer_function_sg_recall_deferred_events (void *data) + { + amf_sg_t *sg = (amf_sg_t*)data; +- ENTER (""); ++ ENTER (); + + sg_recall_deferred_events (sg); + } +@@ -473,7 +473,7 @@ + { + SaNameT dn; + +- ENTER ("sg: %s state: %d", sg->name.value, sg->avail_state); ++ ENTER (); + + sg->avail_state = SG_AC_Idle; + if (sg->recovery_scope.event_type != 0) { +@@ -604,7 +604,7 @@ + static void acsm_enter_terminating_suspected (struct amf_sg *sg) + { + struct amf_su **sus= sg->recovery_scope.sus; +- ENTER("%s",sg->name.value); ++ ENTER(); + sg->avail_state = SG_AC_TerminatingSuspected; + /* + * Terminate suspected SU(s) +@@ -636,7 +636,7 @@ + { + amf_sg_t *sg = (amf_sg_t *)data; + +- ENTER (""); ++ ENTER (); + dependent_si_deactivated_cbfn2 (sg); + } + +@@ -712,7 +712,7 @@ + + sg->avail_state = SG_AC_DeactivatingDependantWorkload; + +- ENTER("'%s'",sg->name.value); ++ ENTER(); + /* + * For each SI in the recovery scope, find all active + * assignments and request them to be deactivated. +@@ -746,7 +746,7 @@ + + if (callback_pending == 0) { + static corosync_timer_handle_t dependent_si_deactivated_handle; +- ENTER(""); ++ ENTER(); + api->timer_add_duration ( + 0, sg, + timer_function_dependent_si_deactivated2, +@@ -764,7 +764,7 @@ + struct amf_si_assignment *si_assignment; + int is_no_standby_activated = 1; + +- ENTER("'%s'",sg->name.value); ++ ENTER(); + sg->avail_state = SG_AC_ActivatingStandby; + + /* +@@ -800,7 +800,7 @@ + int is_any_su_instantiated = 0; + const int PERFORMS_INSTANTIATING = 1; + +- ENTER("'%s'",sg->name.value); ++ ENTER(); + sg->avail_state = SG_AC_ReparingSu; + /* + * Instantiate SUs in current recovery scope until the configured +@@ -835,7 +835,7 @@ + static inline void remove_all_suspected_sus (amf_sg_t *sg) + { + amf_su_t *su; +- ENTER(""); ++ ENTER(); + for (su = sg->su_head; su != NULL; su =su->next) { + + amf_comp_t *component; +@@ -946,7 +946,7 @@ + */ + static void assume_standby_si_assignment_for_spare_sus (amf_sg_t *sg) + { +- ENTER(""); ++ ENTER(); + + assign_si (sg, 0); + } +@@ -957,7 +957,7 @@ + */ + static void acsm_enter_assigning_standby_to_spare (amf_sg_t *sg) + { +- ENTER("%s", sg->name.value); ++ ENTER(); + + sg->avail_state = SG_AC_AssigningStandbyToSpare; + if (is_spare_sus (sg)) { +@@ -971,7 +971,7 @@ + acsm_enter_repairing_su (sg); + break; + default: +- dprintf("event_type %d",sg->recovery_scope.event_type); ++ TRACE1("event_type %d",sg->recovery_scope.event_type); + assert (0); + break; + } +@@ -1006,8 +1006,6 @@ + int number_of_si = 2; /* It shall be at least two */ + struct amf_si **tmp_sis= sg->recovery_scope.sis; + +- ENTER ("'%s'", si->name.value); +- + while (*tmp_sis != NULL) { + number_of_si++; + tmp_sis++; +@@ -1037,7 +1035,7 @@ + int number_of_su = 2; /* It shall be at least two */ + struct amf_su **tmp_sus= sg->recovery_scope.sus; + +- ENTER ("'%s'", su->name.value); ++ ENTER (); + while (*tmp_sus != NULL) { + number_of_su++; + tmp_sus++; +@@ -1096,15 +1094,15 @@ + } + + sus = sg->recovery_scope.sus; +- dprintf("The following sus are within the scope:\n"); ++ TRACE1("The following sus are within the scope:\n"); + while (*sus != NULL) { +- dprintf("%s\n", (*sus)->name.value); ++ TRACE1("%s\n", (*sus)->name.value); + sus++; + } + sis= sg->recovery_scope.sis; +- dprintf("The following sis are within the scope:\n"); ++ TRACE1("The following sis are within the scope:\n"); + while (*sis != NULL) { +- dprintf("%s\n", (*sis)->name.value); ++ TRACE1("%s\n", (*sis)->name.value); + sis++; + } + } +@@ -1116,7 +1114,7 @@ + struct amf_su **sus; + struct amf_su *su; + +- ENTER ("'%s'", node->name.value); ++ ENTER (); + sg->recovery_scope.event_type = SG_FAILOVER_NODE_EV; + sg->recovery_scope.node = node; + sg->recovery_scope.comp = NULL; +@@ -1153,15 +1151,15 @@ + } + + sus = sg->recovery_scope.sus; +- dprintf("The following sus are within the scope:\n"); ++ TRACE1("The following sus are within the scope:\n"); + while (*sus != NULL) { +- dprintf("%s\n", (*sus)->name.value); ++ TRACE1("%s\n", (*sus)->name.value); + sus++; + } + sis = sg->recovery_scope.sis; +- dprintf("The following sis are within the scope:\n"); ++ TRACE1("The following sis are within the scope:\n"); + while (*sis != NULL) { +- dprintf("%s\n", (*sis)->name.value); ++ TRACE1("%s\n", (*sis)->name.value); + sis++; + } + } +@@ -1184,7 +1182,7 @@ + + amf_si_assignment_t *to_be_removed = si_assignment_tmp; + *prev = si_assignment_tmp->next; +- dprintf ("SI assignment %s unlinked", ++ TRACE1 ("SI assignment %s unlinked", + to_be_removed->name.value); + free (to_be_removed); + } else { +@@ -1205,7 +1203,7 @@ + struct amf_si_assignment *si_assignment; + struct amf_si_assignment **prev; + +- ENTER ("'%s'", su->name.value); ++ ENTER (); + + for (si = su->sg->application->si_head; si != NULL; si = si->next) { + +@@ -1224,7 +1222,7 @@ + if (si_assignment->su == su) { + struct amf_si_assignment *tmp = si_assignment; + *prev = si_assignment->next; +- dprintf ("SI assignment %s unlinked", tmp->name.value); ++ TRACE1 ("SI assignment %s unlinked", tmp->name.value); + free (tmp); + } else { + prev = &si_assignment->next; +@@ -1299,7 +1297,7 @@ + { + amf_si_assignment_t *si_assignment = si_assignment_in; + +- ENTER(""); ++ ENTER(); + delete_si_assignment (si_assignment); + + /* +@@ -1323,7 +1321,7 @@ + amf_su_t *standby_su; + int removed = 0; + +- ENTER("'%s'", sg->name.value); ++ ENTER(); + + /* + * For each SI in the recovery scope, find a standby +@@ -1375,7 +1373,7 @@ + */ + static void acsm_enter_removing_standby_assignments (amf_sg_t *sg) + { +- ENTER("SG: %s", sg->name.value); ++ ENTER(); + sg->avail_state = SG_AC_RemovingStandbyAssignments; + + if (sg->saAmfSGRedundancyModel == SA_AMF_NPM_REDUNDANCY_MODEL) { +@@ -1530,7 +1528,7 @@ + int si_left; + int si_total; + int su_left_to_assign = su_active_assign; +- ENTER("SG: %s", sg->name.value); ++ ENTER(); + + si_total = sg_si_count_get (sg); + si_left = si_total; +@@ -1570,13 +1568,13 @@ + su = su->next; + su_left_to_assign -= 1; + si_left -= assigned; +- dprintf (" su_left_to_assign =%d, si_left=%d\n", ++ TRACE1 (" su_left_to_assign =%d, si_left=%d\n", + su_left_to_assign, si_left); + } + + assert (total_assigned <= si_total); + if (total_assigned == 0) { +- dprintf ("Info: No SIs assigned"); ++ TRACE1 ("Info: No SIs assigned"); + } + + return total_assigned; +@@ -1593,7 +1591,7 @@ + int si_total; + int su_left_to_assign = su_standby_assign; + +- ENTER ("'%s'", sg->name.value); ++ ENTER (); + + if (su_standby_assign == 0) { + return 0; +@@ -1635,7 +1633,7 @@ + } + su_left_to_assign -= 1; + si_left -= assigned; +- dprintf (" su_left_to_assign =%d, si_left=%d\n", ++ TRACE1 (" su_left_to_assign =%d, si_left=%d\n", + su_left_to_assign, si_left); + + su = su->next; +@@ -1643,7 +1641,7 @@ + + assert (total_assigned <= si_total); + if (total_assigned == 0) { +- dprintf ("Info: No SIs assigned!"); ++ TRACE1 ("Info: No SIs assigned!"); + } + + return total_assigned; +@@ -1726,7 +1724,7 @@ + int assigned = 0; + int active_out_of_service = 0; + int standby_out_of_service = 0; +- ENTER ("'%s'", sg->name.value); ++ ENTER (); + + /** + * Phase 1: Calculate assignments and create all runtime objects in +@@ -1760,7 +1758,7 @@ + + } + +- dprintf ("(inservice=%d) (active_sus_needed=%d) (standby_sus_needed=%d)" ++ TRACE1 ("(inservice=%d) (active_sus_needed=%d) (standby_sus_needed=%d)" + "\n", + inservice_count, active_sus_needed, standby_sus_needed); + +@@ -1768,7 +1766,7 @@ + * to assign based upon reduction procedure + */ + if ((inservice_count < active_sus_needed - active_out_of_service)) { +- dprintf ("assignment VI - partial assignment with SIs drop outs\n"); ++ TRACE1 ("assignment VI - partial assignment with SIs drop outs\n"); + + su_active_assign = inservice_count; + su_standby_assign = 0; +@@ -1776,7 +1774,7 @@ + } else + if ((inservice_count < active_sus_needed - active_out_of_service + + standby_sus_needed)) { +- dprintf ("assignment V - partial assignment with reduction of" ++ TRACE1 ("assignment V - partial assignment with reduction of" + " standby units\n"); + + su_active_assign = active_sus_needed; +@@ -1784,7 +1782,7 @@ + su_spare_assign = 0; + } else + if ((inservice_count < sg->saAmfSGNumPrefActiveSUs + standby_sus_needed)) { +- dprintf ("IV: full assignment with reduction of active service" ++ TRACE1 ("IV: full assignment with reduction of active service" + " units\n"); + su_active_assign = inservice_count - standby_sus_needed; + su_standby_assign = standby_sus_needed; +@@ -1792,7 +1790,7 @@ + } else + if ((inservice_count < + sg->saAmfSGNumPrefActiveSUs + sg->saAmfSGNumPrefStandbySUs)) { +- dprintf ("III: full assignment with reduction of standby service" ++ TRACE1 ("III: full assignment with reduction of standby service" + " units\n"); + su_active_assign = sg->saAmfSGNumPrefActiveSUs; + su_standby_assign = inservice_count - sg->saAmfSGNumPrefActiveSUs; +@@ -1801,23 +1799,23 @@ + if ((inservice_count == + sg->saAmfSGNumPrefActiveSUs + sg->saAmfSGNumPrefStandbySUs)) { + if (sg->saAmfSGNumPrefInserviceSUs > inservice_count) { +- dprintf ("II: full assignment with spare reduction\n"); ++ TRACE1 ("II: full assignment with spare reduction\n"); + } else { +- dprintf ("II: full assignment without spares\n"); ++ TRACE1 ("II: full assignment without spares\n"); + } + + su_active_assign = sg->saAmfSGNumPrefActiveSUs; + su_standby_assign = sg->saAmfSGNumPrefStandbySUs; + su_spare_assign = 0; + } else { +- dprintf ("I: full assignment with spares\n"); ++ TRACE1 ("I: full assignment with spares\n"); + su_active_assign = sg->saAmfSGNumPrefActiveSUs; + su_standby_assign = sg->saAmfSGNumPrefStandbySUs; + su_spare_assign = inservice_count - + sg->saAmfSGNumPrefActiveSUs - sg->saAmfSGNumPrefStandbySUs; + } + +- dprintf ("(inservice=%d) (assigning active=%d) (assigning standby=%d)" ++ TRACE1 ("(inservice=%d) (assigning active=%d) (assigning standby=%d)" + " (assigning spares=%d)\n", + inservice_count, su_active_assign, su_standby_assign, su_spare_assign); + +@@ -1851,7 +1849,7 @@ + } + } + +- LEAVE ("'%s'", sg->name.value); ++ LEAVE (); + return assigned; + } + +@@ -1948,7 +1946,7 @@ + */ + static void sg_su_state_changed_to_instantiated (struct amf_sg *sg, struct amf_su *su) + { +- ENTER("%s %s",sg->name.value, su->name.value); ++ ENTER(); + switch (sg->avail_state) { + case SG_AC_InstantiatingServiceUnits: + if (no_su_has_presence_state(sg, sg->node_to_start, +@@ -1969,13 +1967,13 @@ + acsm_enter_idle (sg); + } + } else { +- dprintf ("avail-state: %u", sg->avail_state); ++ TRACE1 ("avail-state: %u", sg->avail_state); + assert (0); + } + } + break; + default: +- dprintf ("avail-state: %u", sg->avail_state); ++ TRACE1 ("avail-state: %u", sg->avail_state); + assert (0); + break; + } +@@ -1990,7 +1988,7 @@ + static void amf_sg_su_state_changed_to_uninstantiated (amf_sg_t *sg, + amf_su_t *su) + { +- ENTER("%s %s",sg->name.value, su->name.value); ++ ENTER(); + switch (sg->avail_state) { + case SG_AC_TerminatingSuspected: + if (no_su_has_presence_state(sg, sg->node_to_start, +@@ -2042,7 +2040,7 @@ + static void amf_sg_su_state_changed_to_termination_failed (amf_sg_t *sg, + amf_su_t *su) + { +- ENTER("%s %s",sg->name.value, su->name.value); ++ ENTER(); + if (no_su_has_presence_state(sg, sg->node_to_start, + SA_AMF_PRESENCE_TERMINATING)) { + if (is_comp_in_active_ha_state_nplusm (sg, su)) { +@@ -2078,7 +2076,7 @@ + static void amf_sg_su_state_changed_to_instantiation_failed (amf_sg_t *sg, + amf_su_t *su) + { +- ENTER("%s %s",sg->name.value, su->name.value); ++ ENTER(); + switch (sg->avail_state) { + case SG_AC_InstantiatingServiceUnits: + if (no_su_has_presence_state(sg, sg->node_to_start, +@@ -2103,7 +2101,7 @@ + break; + default: + /* TODO: Insert the assert (0) until solving defers in SU */ +- dprintf("sg->avail_state = %d", sg->avail_state); ++ TRACE1("sg->avail_state = %d", sg->avail_state); + break; + } + } +@@ -2123,7 +2121,7 @@ + { + + sg->recovery_scope.event_type = SG_START_EV; +- ENTER ("'%s'", sg->name.value); ++ ENTER (); + int instantiated_sus = 0; + + switch (sg->avail_state) { +@@ -2133,7 +2131,7 @@ + amf_su_t *su; + sg_avail_control_state_t old_avail_state = sg->avail_state; + +- ENTER ("'%s'", sg->name.value); ++ ENTER (); + + sg->node_to_start = node; + +@@ -2221,7 +2219,7 @@ + */ + void amf_sg_failover_node_req (struct amf_sg *sg, struct amf_node *node) + { +- ENTER("'%s, %s'",node->name.value, sg->name.value); ++ ENTER(); + sg_event_t sg_event; + + switch (sg->avail_state) { +@@ -2239,8 +2237,7 @@ + while (*sus != NULL) { + + amf_su_t *su = *sus; +- ENTER("SU %s pr_state='%d'",su->name.value, +- su->saAmfSUPresenceState); ++ ENTER(); + + if (su_presense_state_is_ored (su, + SA_AMF_PRESENCE_UNINSTANTIATED, +@@ -2296,7 +2293,7 @@ + void amf_sg_failover_su_req (struct amf_sg *sg, struct amf_su *su, + struct amf_node *node) + { +- ENTER ("%s", su->name.value); ++ ENTER (); + sg_event_t sg_event; + + switch (sg->avail_state) { +@@ -2340,8 +2337,7 @@ + void amf_sg_su_state_changed_2 (struct amf_sg *sg, + struct amf_su *su, SaAmfStateT type, int state) + { +- ENTER ("'%s' SU '%s' state %s", +- sg->name.value, su->name.value, amf_presence_state(state)); ++ ENTER (); + + if (type == SA_AMF_PRESENCE_STATE) { + if (state == SA_AMF_PRESENCE_INSTANTIATED) { +@@ -2362,11 +2358,11 @@ + } + + } else { +- dprintf ("avail-state: %u", sg->avail_state); ++ TRACE1 ("avail-state: %u", sg->avail_state); + assert (0); + } + } else { +- dprintf ("avail-state: %u", sg->avail_state); ++ TRACE1 ("avail-state: %u", sg->avail_state); + assert (0); + } + } else if (state == SA_AMF_PRESENCE_UNINSTANTIATED) { +@@ -2396,7 +2392,7 @@ + acsm_enter_idle (sg); + } + } else { +- dprintf("%d",sg->avail_state); ++ TRACE1("%d",sg->avail_state); + assert (0); + } + } +@@ -2444,11 +2440,11 @@ + } + } else { + /* TODO: Insert the assert (0) until solving defers in SU */ +- dprintf("sg->avail_state = %d, su instantiation state = %d", ++ TRACE1("sg->avail_state = %d, su instantiation state = %d", + sg->avail_state, state); + } + } else { +- dprintf("sg->avail_state = %d, su instantiation state = %d", ++ TRACE1("sg->avail_state = %d, su instantiation state = %d", + sg->avail_state, state); + assert (0); + } +@@ -2467,8 +2463,7 @@ + void amf_sg_su_state_changed (struct amf_sg *sg, struct amf_su *su, + SaAmfStateT type, int state) + { +- ENTER ("'%s' SU '%s' state %s", +- sg->name.value, su->name.value, amf_presence_state(state)); ++ ENTER (); + + if (sg->avail_state != SG_AC_Idle) { + if (type == SA_AMF_PRESENCE_STATE) { +@@ -2492,7 +2487,7 @@ + ; /* nop */ + break; + default : +- dprintf("sg->avail_state = %d, su instantiation state = %d", ++ TRACE1("sg->avail_state = %d, su instantiation state = %d", + sg->avail_state, state); + assert (0); + break; +@@ -2510,7 +2505,7 @@ + { + struct amf_su **sus = sg->recovery_scope.sus; + +- ENTER("'%s'", sg->name.value); ++ ENTER(); + + /* + * Select next state depending on if some +@@ -2520,8 +2515,7 @@ + while (*sus != NULL) { + amf_su_t *su = *sus; + +- ENTER("SU %s pr_state='%d'",su->name.value, +- su->saAmfSUPresenceState); ++ ENTER(); + + if (su_presense_state_is_ored (su, + SA_AMF_PRESENCE_UNINSTANTIATED, +@@ -2554,7 +2548,7 @@ + struct amf_su **sus = sg->recovery_scope.sus; + struct amf_su *su; + +- ENTER ("'%s', %d", si_assignment->si->name.value, result); ++ ENTER (); + + /* + * If all SI assignments for all SUs in the SG are not pending, +@@ -2599,7 +2593,7 @@ + acsm_enter_removing_standby_assignments (sg); + } + } +- LEAVE(""); ++ LEAVE(); + } + + /** +@@ -2615,7 +2609,7 @@ + int si_assignment_cnt = 0; + int confirmed_assignments = 0; + +- ENTER ("'%s', %d", si_assignment->si->name.value, result); ++ ENTER (); + + + switch (sg->avail_state) { +@@ -2624,7 +2618,7 @@ + acsm_enter_idle (sg); + amf_application_sg_assigned (sg->application, sg); + } else { +- dprintf ("%d, %d", si_assignment_cnt, confirmed_assignments); ++ TRACE1 ("%d, %d", si_assignment_cnt, confirmed_assignments); + } + break; + case SG_AC_AssigningWorkload: +@@ -2660,7 +2654,7 @@ + } + break; + default: +- dprintf ("%d, %d, %d", sg->avail_state, si_assignment_cnt, ++ TRACE1 ("%d, %d, %d", sg->avail_state, si_assignment_cnt, + confirmed_assignments); + amf_runtime_attributes_print (amf_cluster); + assert (0); +@@ -2680,7 +2674,7 @@ + struct amf_su **sus = si_assignment->su->sg->recovery_scope.sus; + struct amf_si **sis = si_assignment->su->sg->recovery_scope.sis; + +- ENTER ("'%s', %d", si_assignment->si->name.value, result); ++ ENTER (); + + /* + * If all SI assignments for all SIs in the scope are activated, goto next +diff -urNad openais-0.91~/services/amfsi.c openais-0.91/services/amfsi.c +--- openais-0.91~/services/amfsi.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfsi.c 2009-01-27 07:29:39.000000000 +0100 +@@ -297,7 +297,7 @@ + void amf_si_comp_set_ha_state_done ( + struct amf_si *si, struct amf_csi_assignment *csi_assignment) + { +- ENTER ("'%s', '%s'", si->name.value, csi_assignment->csi->name.value); ++ ENTER (); + + set_si_ha_state (csi_assignment); + +@@ -322,7 +322,7 @@ + { + struct amf_csi *csi; + +- ENTER ("'%s'", si->name.value); ++ ENTER (); + + for (csi = si->csi_head; csi != NULL; csi = csi->next) { + struct amf_csi_assignment *csi_assignment; +@@ -346,7 +346,7 @@ + void amf_si_comp_set_ha_state_failed ( + struct amf_si *si, struct amf_csi_assignment *csi_assignment) + { +- ENTER (""); ++ ENTER (); + assert (0); + } + +@@ -354,7 +354,7 @@ + { + struct amf_si_assignment *si_assignment = _si_assignment; + +- ENTER (""); ++ ENTER (); + si_assignment->saAmfSISUHAState = si_assignment->requested_ha_state; + si_assignment->assumed_callback_fn (si_assignment, 0); + } +@@ -369,9 +369,7 @@ + int csi_assignment_cnt = 0; + int hastate_set_done_cnt = 0; + +- ENTER ("SI '%s' SU '%s' state %s", si_assignment->si->name.value, +- si_assignment->su->name.value, +- amf_ha_state (si_assignment->requested_ha_state)); ++ ENTER (); + + si_assignment->assumed_callback_fn = assumed_ha_state_callback_fn; + for (csi = si_assignment->si->csi_head; csi != NULL; csi = csi->next) { +@@ -509,7 +507,7 @@ + void amf_csi_delete_assignments (struct amf_csi *csi, struct amf_su *su) + { + struct amf_csi_assignment *csi_assignment; +- ENTER ("'%s'", su->name.value); ++ ENTER (); + struct amf_csi_assignment **prev = &csi->assigned_csis; + + for (csi_assignment = csi->assigned_csis; csi_assignment != NULL; +@@ -517,7 +515,7 @@ + if (csi_assignment->comp->su == su) { + struct amf_csi_assignment *tmp = csi_assignment; + *prev = csi_assignment->next; +- dprintf ("CSI assignment %s unlinked", tmp->name.value); ++ TRACE1 ("CSI assignment %s unlinked", tmp->name.value); + free (tmp); + } else { + prev = &csi_assignment->next; +@@ -689,7 +687,7 @@ + } + + if (si == NULL) { +- dprintf ("SI %s not found!", name); ++ TRACE1 ("SI %s not found!", name); + } + + return si; +@@ -761,7 +759,7 @@ + } + + if (csi == NULL) { +- dprintf ("CSI %s not found!", name); ++ TRACE1 ("CSI %s not found!", name); + } + return csi; + } +@@ -1000,9 +998,7 @@ + struct amf_csi *csi; + int csi_assignment_cnt = 0; + +- ENTER ("SI '%s' SU '%s' state %s", si_assignment->si->name.value, +- si_assignment->su->name.value, +- amf_ha_state (si_assignment->requested_ha_state)); ++ ENTER (); + + si_assignment->requested_ha_state = USR_AMF_HA_STATE_REMOVED; + si_assignment->removed_callback_fn = async_func; +@@ -1042,7 +1038,7 @@ + struct amf_si *si, struct amf_csi_assignment *csi_assignment, + SaAisErrorT error) + { +- ENTER ("'%s', '%s'", si->name.value, csi_assignment->csi->name.value); ++ ENTER (); + + assert (csi_assignment->si_assignment->removed_callback_fn != NULL); + +diff -urNad openais-0.91~/services/amfsu.c openais-0.91/services/amfsu.c +--- openais-0.91~/services/amfsu.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfsu.c 2009-01-27 07:29:39.000000000 +0100 +@@ -421,7 +421,7 @@ + su_event_t event; + su_event_set(su, comp, recommended_recovery,&event, su_event_type); + +- ENTER("event_type = %d", event.event_type); ++ ENTER(); + amf_fifo_put (event.event_type, &event.su->deferred_events, + sizeof (su_event_t), &event); + } +@@ -430,7 +430,7 @@ + { + su_event_t su_event; + +- ENTER ("%s", su->name.value); ++ ENTER (); + if (amf_fifo_get (&su->deferred_events, &su_event)) { + switch (su_event.event_type) { + case SU_COMP_ERROR_SUSPECTED_EV: +@@ -438,7 +438,7 @@ + su_event.recommended_recovery); + break; + default: +- dprintf("event_type = %d", su_event.event_type); ++ TRACE1("event_type = %d", su_event.event_type); + break; + } + } +@@ -472,7 +472,7 @@ + static void clear_ha_state ( + struct amf_su *su, struct amf_si_assignment *si_assignment) + { +- ENTER (""); ++ ENTER (); + si_assignment->saAmfSISUHAState = 0; + } + +@@ -564,7 +564,7 @@ + { + struct amf_csi_assignment *csi_assignment; + +- dprintf (" Creating CSI '%s' to comp '%s' with hastate %s\n", ++ TRACE1 (" Creating CSI '%s' to comp '%s' with hastate %s\n", + getSaNameT (&csi->name), getSaNameT (&comp->name), + amf_ha_state (ha_state)); + +@@ -584,7 +584,7 @@ + { + SaNameT dn; + +- ENTER ("'%s'", comp->name.value); ++ ENTER (); + amf_comp_dn_make (comp, &dn); + log_printf (LOG_NOTICE, "Error detected for '%s', recovery " + "action: Component restart", dn.value); +@@ -609,7 +609,7 @@ + { + struct amf_si_assignment *si_assignment; + +- ENTER (""); ++ ENTER (); + + si_assignment = amf_su_get_next_si_assignment(su, NULL); + +@@ -729,8 +729,7 @@ + static void su_comp_presence_state_changed (struct amf_su *su, + struct amf_comp *comp, int state) + { +- ENTER ("'%s', '%s' %d %d", su->name.value, comp->name.value, state, +- su->restart_control_state); ++ ENTER (); + amf_node_t *node = amf_node_find (&comp->su->saAmfSUHostedByNode); + switch (state) { + case SA_AMF_PRESENCE_INSTANTIATED: +@@ -782,7 +781,7 @@ + } + break; + default: +- dprintf ("state %d", su->restart_control_state); ++ TRACE1 ("state %d", su->restart_control_state); + assert (0); + break; + } +@@ -863,7 +862,7 @@ + } + break; + default: +- dprintf ("state %d", su->restart_control_state); ++ TRACE1 ("state %d", su->restart_control_state); + assert (0); + break; + } +@@ -905,7 +904,7 @@ + } + break; + default: +- dprintf ("state %d", su->restart_control_state); ++ TRACE1 ("state %d", su->restart_control_state); + assert (0); + break; + } +@@ -945,7 +944,7 @@ + default: + log_printf (LOG_LEVEL_NOTICE,"%s %d",su->name.value, + su->restart_control_state); +- dprintf ("state %d", su->restart_control_state); ++ TRACE1 ("state %d", su->restart_control_state); + assert (0); + break; + } +@@ -965,7 +964,7 @@ + static void su_comp_op_state_changed ( + struct amf_su *su, struct amf_comp *comp, int state) + { +- ENTER ("'%s', '%s' %d", su->name.value, comp->name.value, state); ++ ENTER (); + + switch (state) { + case SA_AMF_OPERATIONAL_ENABLED: +@@ -1064,7 +1063,7 @@ + static void su_rc_enter_idle_escalation_level_1 (amf_comp_t *component, + SaAmfRecommendedRecoveryT recommended_recovery) + { +- ENTER(""); ++ ENTER(); + component->su->restart_control_state = SU_RC_IDLE_ESCALATION_LEVEL_1; + if (has_component_restarted_max_times (component, component->su)) { + component->su->restart_control_state = SU_RC_IDLE_ESCALATION_LEVEL_2; +@@ -1076,7 +1075,7 @@ + static void su_rc_enter_idle_escalation_level_2 (amf_comp_t *component, + SaAmfRecommendedRecoveryT recommended_recovery) + { +- ENTER(""); ++ ENTER(); + component->su->restart_control_state = SU_RC_IDLE_ESCALATION_LEVEL_2; + amf_node_t *node = amf_node_find (&component->su->saAmfSUHostedByNode); + amf_node_comp_restart_req (node, component); +@@ -1157,7 +1156,7 @@ + { + int is_instantiating = 1; + +- ENTER ("'%s %d'", su->name.value, su->saAmfSUPresenceState); ++ ENTER (); + switch (su->saAmfSUPresenceState) { + case SA_AMF_PRESENCE_UNINSTANTIATED: + instantiate_all_components_in_level(su, +@@ -1186,7 +1185,7 @@ + */ + void amf_su_terminate (struct amf_su *su) + { +- ENTER ("'%s'", su->name.value); ++ ENTER (); + su->current_comp_instantiation_level = get_instantiation_max_level (su); + + terminate_all_components_in_level (su, su->current_comp_instantiation_level); +@@ -1203,8 +1202,7 @@ + struct amf_comp *comp, + SaAmfRecommendedRecoveryT recommended_recovery) + { +- ENTER ("Comp '%s', SU '%s' %d", comp->name.value, su->name.value, +- su->restart_control_state); ++ ENTER (); + + switch (su->restart_control_state) { + case SU_RC_IDLE_ESCALATION_LEVEL_0: +@@ -1255,7 +1253,7 @@ + SU_COMP_ERROR_SUSPECTED_EV); + break; + default: +- dprintf ("restart_control_state = %d",su->restart_control_state); ++ TRACE1 ("restart_control_state = %d",su->restart_control_state); + break; + } + } +@@ -1268,7 +1266,7 @@ + { + SaNameT dn; + +- ENTER ("'%s'", su->name.value); ++ ENTER (); + + amf_su_dn_make (su, &dn); + log_printf (LOG_NOTICE, "Error detected for '%s', recovery " +@@ -1316,7 +1314,7 @@ + struct amf_comp *comp; + struct amf_csi_assignment *csi_assignment; + int all_confirmed = 1; +- ENTER (""); ++ ENTER (); + tmp_si_assignment = amf_su_get_next_si_assignment(si_assignment->su, NULL); + + while (tmp_si_assignment != NULL) { +@@ -1572,7 +1570,7 @@ + { + struct amf_si_assignment *si_assignment; + +- dprintf ("Creating SI '%s' to SU '%s' with hastate %s\n", ++ TRACE1 ("Creating SI '%s' to SU '%s' with hastate %s\n", + getSaNameT (&si->name), getSaNameT (&su->name), + amf_ha_state (ha_state)); + +diff -urNad openais-0.91~/services/amfutil.c openais-0.91/services/amfutil.c +--- openais-0.91~/services/amfutil.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/amfutil.c 2009-01-27 07:29:39.000000000 +0100 +@@ -1303,7 +1303,7 @@ + + int i; + +- ENTER("'%s %s'",string, pattern); ++ ENTER(); + + if (regcomp(&re, pattern, REG_EXTENDED) != 0) { + status = 0; +@@ -1345,7 +1345,7 @@ + + int i; + +- ENTER("'%s %s'",string, pattern); ++ ENTER(); + if (regcomp(&re, pattern, REG_EXTENDED) != 0) { + status = 0; + goto out; +@@ -1390,7 +1390,7 @@ + int iov_cnt; + int res; + +-// ENTER ("%u, %p, %u", msg_id, buf, len); ++ ENTER (); + + msg.header.size = sizeof (msg); + msg.header.id = SERVICE_ID_MAKE (AMF_SERVICE, msg_id); +@@ -1410,7 +1410,7 @@ + res = api->totem_mcast (iov, iov_cnt, TOTEM_AGREED); + + if (res != 0) { +- dprintf("Unable to send %d bytes\n", msg.header.size); ++ TRACE1("Unable to send %d bytes\n", msg.header.size); + corosync_fatal_error (COROSYNC_FATAL_ERR); + } + +diff -urNad openais-0.91~/services/ckpt.c openais-0.91/services/ckpt.c +--- openais-0.91~/services/ckpt.c 2008-09-17 21:18:35.000000000 +0200 ++++ openais-0.91/services/ckpt.c 2009-01-27 07:29:39.000000000 +0100 +@@ -1282,13 +1282,13 @@ + /* + * If checkpoint doesn't exist, create one + */ +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + if ((req_exec_ckpt_checkpointopen->checkpoint_open_flags & SA_CKPT_CHECKPOINT_CREATE) == 0) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } + checkpoint = malloc (sizeof (struct checkpoint)); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NO_MEMORY; + goto error_exit; + } +@@ -1480,7 +1480,7 @@ + &checkpoint_list_head, + &ckpt_id->ckpt_name, + ckpt_id->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + log_printf (LOG_LEVEL_ERROR, "timer_function_section_expire could not find ckpt %s\n", + ckpt_id->ckpt_name.value); + goto free_mem; +@@ -1550,7 +1550,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_checkpointclose->checkpoint_name, + req_exec_ckpt_checkpointclose->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1614,7 +1614,7 @@ + checkpoint = checkpoint_find_linked ( + &checkpoint_list_head, + &req_exec_ckpt_checkpointunlink->checkpoint_name); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1754,7 +1754,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectioncreate->checkpoint_name, + req_exec_ckpt_sectioncreate->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1917,7 +1917,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectiondelete->checkpoint_name, + req_exec_ckpt_sectiondelete->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -1985,7 +1985,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionexpirationtimeset->checkpoint_name, + req_exec_ckpt_sectionexpirationtimeset->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -2079,7 +2079,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionwrite->checkpoint_name, + req_exec_ckpt_sectionwrite->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + log_printf (LOG_LEVEL_ERROR, "checkpoint_find returned 0 Calling error_exit.\n"); + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; +@@ -2188,7 +2188,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionoverwrite->checkpoint_name, + req_exec_ckpt_sectionoverwrite->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_NOT_EXIST; + goto error_exit; + } +@@ -2288,7 +2288,7 @@ + &checkpoint_list_head, + &req_exec_ckpt_sectionread->checkpoint_name, + req_exec_ckpt_sectionread->ckpt_id); +- if (checkpoint == 0) { ++ if (checkpoint == NULL) { + error = SA_AIS_ERR_LIBRARY; + goto error_exit; + } +@@ -2566,11 +2566,15 @@ + /* + * Make sure checkpoint is collocated and async update option + */ ++ if (checkpoint == NULL) { ++ error = SA_AIS_ERR_NOT_EXIST; ++ } else + if (((checkpoint->checkpoint_creation_attributes.creation_flags & SA_CKPT_CHECKPOINT_COLLOCATED) == 0) || + (checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + error = SA_AIS_ERR_BAD_OPERATION; ++ } else { ++ checkpoint->active_replica_set = 1; + } +- checkpoint->active_replica_set = 1; + res_lib_ckpt_activereplicaset.header.size = sizeof (struct res_lib_ckpt_activereplicaset); + res_lib_ckpt_activereplicaset.header.id = MESSAGE_RES_CKPT_ACTIVEREPLICASET; + res_lib_ckpt_activereplicaset.header.error = error; +@@ -2952,6 +2956,9 @@ + &checkpoint_list_head, + &req_lib_ckpt_checkpointsynchronize->checkpoint_name, + req_lib_ckpt_checkpointsynchronize->ckpt_id); ++ if (checkpoint == NULL) { ++ res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_ERR_NOT_EXIST; ++ } else + if ((checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + res_lib_ckpt_checkpointsynchronize.header.error = SA_AIS_ERR_BAD_OPERATION; + } else +@@ -2982,6 +2989,9 @@ + &checkpoint_list_head, + &req_lib_ckpt_checkpointsynchronizeasync->checkpoint_name, + req_lib_ckpt_checkpointsynchronizeasync->ckpt_id); ++ if (checkpoint == NULL) { ++ res_lib_ckpt_checkpointsynchronizeasync.header.error = SA_AIS_ERR_NOT_EXIST; ++ } else + if ((checkpoint->checkpoint_creation_attributes.creation_flags & (SA_CKPT_WR_ACTIVE_REPLICA | SA_CKPT_WR_ACTIVE_REPLICA_WEAK)) == 0) { + res_lib_ckpt_checkpointsynchronizeasync.header.error = SA_AIS_ERR_BAD_OPERATION; + } else +@@ -3127,9 +3137,10 @@ + res_lib_ckpt_sectioniterationinitialize.header.id = MESSAGE_RES_CKPT_SECTIONITERATIONINITIALIZE; + res_lib_ckpt_sectioniterationinitialize.header.error = error; + res_lib_ckpt_sectioniterationinitialize.iteration_handle = iteration_handle; +- res_lib_ckpt_sectioniterationinitialize.max_section_id_size = +- checkpoint->checkpoint_creation_attributes.max_section_id_size; +- ++ if (checkpoint != NULL) { ++ res_lib_ckpt_sectioniterationinitialize.max_section_id_size = ++ checkpoint->checkpoint_creation_attributes.max_section_id_size; ++ } + api->ipc_conn_send_response ( + conn, + &res_lib_ckpt_sectioniterationinitialize, +diff -urNad openais-0.91~/test/ckptbench.c openais-0.91/test/ckptbench.c +--- openais-0.91~/test/ckptbench.c 2008-07-21 10:21:13.000000000 +0200 ++++ openais-0.91/test/ckptbench.c 2009-01-27 07:29:39.000000000 +0100 +@@ -1,7 +1,7 @@ + #define _BSD_SOURCE + /* + * Copyright (c) 2002-2004 MontaVista Software, Inc. +- * Copyright (c) 2006 Sun Microsystems, Inc. ++ * Copyright (c) 2006-2009 Red Hat, Inc. + * + * All rights reserved. + * +@@ -97,29 +97,29 @@ + SaCkptCheckpointCreationAttributesT checkpointCreationAttributes = { + .creationFlags = SA_CKPT_WR_ALL_REPLICAS, + .checkpointSize = 250000, +- .retentionDuration = 0, ++ .retentionDuration = SA_TIME_END, + .maxSections = 5, + .maxSectionSize = 250000, + .maxSectionIdSize = 15 + }; + + SaCkptSectionIdT sectionId1 = { +- 14, ++ 13, + (SaUint8T *) "section ID #1" + }; + + SaCkptSectionIdT sectionId2 = { +- 14, ++ 13, + (SaUint8T *) "section ID #2" + }; + SaCkptSectionCreationAttributesT sectionCreationAttributes1 = { + §ionId1, +- 0xFFFFFFFF ++ SA_TIME_END + }; + + SaCkptSectionCreationAttributesT sectionCreationAttributes2 = { + §ionId2, +- 0xFFFFFFFF ++ SA_TIME_END + }; + + char readBuffer1[1025]; +@@ -129,7 +129,7 @@ + SaCkptIOVectorElementT ReadVectorElements[] = { + { + { +- 14, ++ 13, + (SaUint8T *) "section ID #1" + }, + readBuffer1, +@@ -139,7 +139,7 @@ + }, + { + { +- 14, ++ 13, + (SaUint8T *) "section ID #2" + }, + readBuffer2, +@@ -156,7 +156,7 @@ + SaCkptIOVectorElementT WriteVectorElements[] = { + { + { +- 14, ++ 13, + (SaUint8T *) "section ID #1" + }, + data, /*"written data #1, this should extend past end of old section data", */ +@@ -167,7 +167,7 @@ + #ifdef COMPILE_OUT + { + { +- 14, ++ 13, + (SaUint8T *) "section ID #2" + }, + data, /*"written data #2, this should extend past end of old section data" */ --- openais-0.91.orig/debian/patches/101_default_conf.dpatch +++ openais-0.91/debian/patches/101_default_conf.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 101_default_conf.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad openais-0.90~/conf/openais.conf openais-0.90/conf/openais.conf +--- openais-0.90~/conf/openais.conf 2008-07-24 14:28:11.000000000 +0200 ++++ openais-0.90/conf/openais.conf 2008-08-05 10:53:20.000000000 +0200 +@@ -3,6 +3,8 @@ + version: 2 + secauth: off + threads: 0 ++ rrp_mode: none ++ vsftype: none + interface { + ringnumber: 0 + bindnetaddr: 192.168.1.1 +@@ -13,10 +15,10 @@ + + logging { + fileline: off +- to_stderr: yes ++ to_stderr: no + to_file: yes + to_syslog: yes +- logfile: /tmp/openais.log ++ logfile: /var/log/openais/openais.log + debug: off + timestamp: on + logger { --- openais-0.91.orig/debian/libopenais2.install +++ openais-0.91/debian/libopenais2.install @@ -0,0 +1,2 @@ +etc/ld* +usr/lib/openais/*.so.2* --- openais-0.91.orig/debian/openais.postinst +++ openais-0.91/debian/openais.postinst @@ -0,0 +1,9 @@ +#!/bin/sh + +# we need ais user + +if [ "$1" = "configure" ]; then + adduser --quiet --group --system --no-create-home ais +fi + +#DEBHELPER# --- openais-0.91.orig/debian/openais.examples +++ openais-0.91/debian/openais.examples @@ -0,0 +1 @@ +conf/* --- openais-0.91.orig/debian/libopenais-dev.install +++ openais-0.91/debian/libopenais-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/openais/*.a +usr/lib/openais/*.so --- openais-0.91.orig/debian/openais.install +++ openais-0.91/debian/openais.install @@ -0,0 +1,4 @@ +etc/ais +usr/sbin +usr/lib/lcrso +usr/share/man* --- openais-0.91.orig/debian/openais.docs +++ openais-0.91/debian/openais.docs @@ -0,0 +1 @@ +README.amf --- openais-0.91.orig/debian/rules +++ openais-0.91/debian/rules @@ -0,0 +1,95 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p') +VERSION := $(shell dpkg-parsechangelog | perl -ne '/^Version:\s+(\S+)-[^-]+$$/ && print $$1;') + +BUILD_DIR = debian/build +STAMPS_DIR = debian/stamps + +export OPENAIS_BUILD=$(if $(findstring debug,$(DEB_BUILD_OPTIONS)),DEBUG,RELEASE) + +setup: $(STAMPS_DIR)/setup + +$(STAMPS_DIR)/setup: SOURCE_FILES = $(filter-out debian, $(wildcard * .[^.]*)) +$(STAMPS_DIR)/setup: DIR = $(BUILD_DIR)/build +$(STAMPS_DIR)/setup: + @[ -d $(BUILD_DIR) ] || mkdir $(BUILD_DIR) + @[ -d $(STAMPS_DIR) ] || mkdir $(STAMPS_DIR) + dh_testdir + @rm -rf $(DIR) + mkdir $(DIR) + cp -a $(SOURCE_FILES) $(DIR) + dpatch -d $(DIR) apply-all + touch $@ + +build: $(STAMPS_DIR)/build + +$(STAMPS_DIR)/build: DIR = $(BUILD_DIR)/build +$(STAMPS_DIR)/build: $(STAMPS_DIR)/setup + dh_testdir + $(MAKE) -C $(DIR) OPENAIS_BUILD=${OPENAIS_BUILD} + touch $@ + +clean: + dh_testdir + rm -rf $(BUILD_DIR) $(STAMPS_DIR) + dh_clean + +maintainerclean: + rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*)) + +install: DIR = $(BUILD_DIR)/build +install: $(STAMPS_DIR)/build + dh_testdir + dh_testroot + dh_clean -k + + $(MAKE) -C $(DIR) install DESTDIR=$(CURDIR)/debian/tmp/ STATICLIBS=YES + dh_install --sourcedir=debian/tmp --list-missing + #dh_installchangelogs CHANGELOG + dh_installdirs + dh_installdocs + dh_installexamples + dh_installinit -p openais -- start 59 S . start 7 0 6 . + dh_installlogrotate + dh_strip +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/openais/usr/lib/lcrso/* +endif + dh_compress + chmod 644 debian/openais/usr/lib/lcrso/*.lcrso + dh_fixperms + dh_makeshlibs -V + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: install + +binary-indep: + +binary: binary-arch binary-indep + +DIR_ORIG = ../orig/$(SOURCE)-$(VERSION) +TAR_ORIG_NAME = $(SOURCE)_$(VERSION).orig.tar.gz +TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME))) + +orig: $(DIR_ORIG) + rsync --delete --exclude debian --exclude .svk --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ . + +$(DIR_ORIG): +ifeq ($(TAR_ORIG),) + $(error Cannot find orig tarball $(TAR_ORIG_NAME)) +else + mkdir -p ../orig + tar -C ../orig -xzf $(TAR_ORIG) +endif + +# This is to make dpatch-edit-patch work +unpatch: clean + --- openais-0.91.orig/debian/openais.init +++ openais-0.91/debian/openais.init @@ -0,0 +1,131 @@ +#! /bin/bash + +# Author: Fabio M. Di Nitto + +# PATH should only include /usr/* if it runs after the mountnfs.sh script +PATH=/usr/sbin:/usr/bin:/sbin:/bin +DESC="openais daemon" +NAME=corosync +DAEMON=/usr/sbin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +export COROSYNC_DEFAULT_CONFIG_IFACE="openaisserviceenable:openaisparser" + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Read corosync configuration variable file if it is present +[ -r /etc/default/corosync ] && . /etc/default/corosync + +# if corosync is executed, do not start it again as openais. +if [ "$START" = "yes" ]; then + exit 0 +fi + +# Read configuration variable file if it is present +[ -r /etc/default/openais ] && . /etc/default/openais + +if [ "$START" != "yes" ]; then + exit 0 +fi + +# Load the VERBOSE setting and other rcS variables +[ -f /etc/default/rcS ] && . /etc/default/rcS + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + # Return + # 0 if daemon has been started + # 1 if daemon was already running + # 2 if daemon could not be started + start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \ + || return 1 + start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS \ + || return 2 + # Add code here, if necessary, that waits for the process to be ready + # to handle requests from services started subsequently which depend + # on this one. As a last resort, sleep for some time. +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + # Return + # 0 if daemon has been stopped + # 1 if daemon was already stopped + # 2 if daemon could not be stopped + # other if a failure occurred + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks + # and if the daemon is only ever run from this initscript. + # If the above conditions are not satisfied then add some other code + # that waits for the process to drop all resources that could be + # needed by services started subsequently. A last resort is to + # sleep for some time. + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON + [ "$?" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. + rm -f $PIDFILE + return "$RETVAL" +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- openais-0.91.orig/debian/openais.postrm +++ openais-0.91/debian/openais.postrm @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ "$1" = purge ]; then + rm -rf /var/lib/openais + rm -rf /var/log/openais +fi + +#DEBHELPER# --- openais-0.91.orig/debian/compat +++ openais-0.91/debian/compat @@ -0,0 +1 @@ +5 --- openais-0.91.orig/debian/openais.dirs +++ openais-0.91/debian/openais.dirs @@ -0,0 +1,2 @@ +var/lib/openais +var/log/openais --- openais-0.91.orig/debian/control +++ openais-0.91/debian/control @@ -0,0 +1,76 @@ +Source: openais +Section: admin +Priority: optional +Maintainer: Fabio M. Di Nitto +XSBC-Original-Maintainer: Debian Kernel Team +Uploaders: Bastian Blank , Frederik Schüler +Standards-Version: 3.7.3 +Build-Depends: dpatch, debhelper (>> 5), libcorosync-dev (>= 0.92-0ubuntu3) + +Package: openais +Section: admin +Architecture: any +Depends: corosync (>= 0.92-0ubuntu3), libopenais2 (= ${binary:Version}), libcorosync2 (>= 0.92-0ubuntu3) +Description: Standards-based cluster framework (daemon and modules) + The openais project is a project to implement a production quality + "Revised BSD" licensed implementation of the SA Forum's Application + Interface Specification. The project implements cutting edge research + on virtual synchrony to provide 100% correct operation in the face of + failures or partitionable networks with excellent performance + characteristics. + . + The Application Interface Specification is a software API and policies + which are used to develop applications that maintain service during + faults. + The API consists of Availability Management Framework (AMF) which + provides application failover, Cluster Membership (CLM), + Checkpointing (CKPT), Event (EVT), Messaging (MSG), and + Distributed Locks (DLOCK). + . + This package contains the openais modules. + +Package: libopenais2 +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: Standards-based cluster framework (libraries) + The openais project is a project to implement a production quality + "Revised BSD" licensed implementation of the SA Forum's Application + Interface Specification. The project implements cutting edge research + on virtual synchrony to provide 100% correct operation in the face of + failures or partitionable networks with excellent performance + characteristics. + . + The Application Interface Specification is a software API and policies + which are used to develop applications that maintain service during + faults. + The API consists of Availability Management Framework (AMF) which + provides application failover, Cluster Membership (CLM), + Checkpointing (CKPT), Event (EVT), Messaging (MSG), and + Distributed Locks (DLOCK). + . + This package contains libraries that should be used by openais clients. + +Package: libopenais-dev +Section: libdevel +Architecture: any +Depends: libopenais2 (= ${binary:Version}), libcorosync-dev +Description: Standards-based cluster framework (developer files) + The openais project is a project to implement a production quality + "Revised BSD" licensed implementation of the SA Forum's Application + Interface Specification. The project implements cutting edge research + on virtual synchrony to provide 100% correct operation in the face of + failures or partitionable networks with excellent performance + characteristics. + . + The Application Interface Specification is a software API and policies + which are used to develop applications that maintain service during + faults. + The API consists of Availability Management Framework (AMF) which + provides application failover, Cluster Membership (CLM), + Checkpointing (CKPT), Event (EVT), Messaging (MSG), and + Distributed Locks (DLOCK). + . + This package contains header files required to build clients for the + openais infrastructure. +