Christine Caulfield wrote: > Steven Dake wrote: >> bOn Tue, 2008-03-04 at 13:39 +0000, Christine Caulfield wrote: >>> David Teigland wrote: >>>> On Mon, Mar 03, 2008 at 05:10:54PM +0100, Fabio M. Di Nitto wrote: >>>>>>> If we are to say this conditional compilation "only works with trunk of >>>>>>> openais up to a certain point such as version 0.84" then that certain >>>>>>> point becomes a "branch point" which I really do not want. What I >>>>>>> prefer is that trunk of gfs userland be munged to work with the new >>>>>>> corosync dependency and once that has all stabilized create a new branch >>>>>>> of userland to work with the corosync 1.0 infrastructure. The complete >>>>>>> software suite then would be "stable3" + "corosync 1.X" + "trunk of >>>>>>> openais ais services" for the checkpoint service. >>>>>> So it sounds like the next stable release of openais will be in the new >>>>>> form of corosync + openais? Will Fedora 9 have whitetank or the new >>>>>> corosync+openais release? >>>>>> >>>>>> We definately need to do a release or two of cluster-2.y.z from STABLE2 >>>>>> based on openais whitetank. Then, once a stable release of >>>>>> corosync+openais exists, I see sense in either: >>>>>> >>>>>> 1. switching STABLE2 from whitetank to the corosync+openais release >>>>>> 2. supporting both whitetank and corosync in STABLE2 somehow, perhaps >>>>>> dropping whitetank support after a while >>>>>> >>>>>> 1 would make most sense if F9 has corosync, 2 would make most sense if F9 >>>>>> has whitetank. >>>>> Clearly STABLE2 is running on truck and what would be corosync+openais >>>>> hopefully in not too long from now. >>>>> >>>>> Does it make sense to roll back to whitetank and back in such short time? >>>>> Let's keep in mind that if we push out stable releases into distro with >>>>> the stable2+whitetank combo, i assume we will need to keep supporting it >>>>> for a while before turning stable2 to support corosync. >>>>> >>>>> Hence my general idea of just #ifdeffing openais support in stable2 to >>>>> handle both whitetank and corosync at build time (no runtime detection) >>>>> and let the users/distros decide what combo they prefer. >>>>> >>>>> If you look at it: >>>>> >>>>> whitetank does not change. stable2 support will only need roll back. >>>>> >>>>> trunk changes in openais. our master follows openais trunk. Commit the >>>>> diff into stable2. It's going to be just a bit painful in the very >>>>> beginning but at the end it's a matter of a cherry pick or almost. >>> It shouldn't be /toooo/ bad. The main thing that keeps cman from >>> compiling against whitetank is the lack of logsys. We don't need to >>> backport logsys to whitetank, just provide a compatibility API for it. >>> Given that most of that is log_printf() that's not going to be very >>> arduous I hope. With luck (and I haven't check this in detail) I hope it >>> can be isolated to the logging.[ch] files. >>>
Here's a first pass at a patch to make STABLE2 work with openais trunk and whitetank. please give it a go (or at least a look) if you can. -- Chrissie
diff --git a/cman/daemon/Makefile b/cman/daemon/Makefile index d32f7bb..ff169e1 100644 --- a/cman/daemon/Makefile +++ b/cman/daemon/Makefile @@ -26,6 +26,7 @@ CFLAGS += -DOPENAIS_EXTERNAL_SERVICE CFLAGS += -fPIC CFLAGS += -I${ccsincdir} -I${openaisincdir} CFLAGS += -I${incdir} +#CFLAGS += -DOPENAIS_WHITETANK LDFLAGS += -L${ccslibdir} -lccs diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c index 286fd15..6f81453 100644 --- a/cman/daemon/ais.c +++ b/cman/daemon/ais.c @@ -37,7 +37,6 @@ #include <openais/service/config.h> #include <openais/lcr/lcr_comp.h> #include <openais/service/swab.h> -#include <openais/service/logsys.h> #include "list.h" #include "cnxman-socket.h" @@ -139,7 +138,7 @@ static inline void objdb_get_int(struct objdb_iface_ver0 *objdb, unsigned int ob * Exports the interface for the service */ static struct openais_service_handler cman_service_handler = { - .name = (char *)"openais CMAN membership service 2.01", + .name = (unsigned char *)"openais CMAN membership service 2.01", .id = CMAN_SERVICE, .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED, .lib_exit_fn = cman_exit_fn, diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index e090674..4696047 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -34,7 +34,6 @@ #include <openais/totem/totemip.h> #include <openais/totem/totempg.h> #include <openais/service/swab.h> -#include <openais/service/logsys.h> #include <openais/service/timer.h> #include <openais/totem/aispoll.h> #include "list.h" diff --git a/cman/daemon/logging.c b/cman/daemon/logging.c index 782a573..f7c626c 100644 --- a/cman/daemon/logging.c +++ b/cman/daemon/logging.c @@ -20,8 +20,11 @@ #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> - +#ifndef OPENAIS_WHITETANK #include <openais/service/logsys.h> +#else +#include <openais/service/objdb.h> +#endif #include "list.h" #include "cnxman-socket.h" #include "cnxman-private.h" @@ -35,3 +38,32 @@ void set_debuglog(int subsystems) { subsys_mask = subsystems; } + +#ifdef OPENAIS_WHITETANK +void set_logger_level(struct objdb_iface_ver0 *objdb, char *ident, int level) +{ + unsigned int object_handle; + unsigned int logger_object_handle; + + fprintf(stderr, "CC: setting logger levels\n"); + objdb->object_find_reset(OBJECT_PARENT_HANDLE); + if (objdb->object_find(OBJECT_PARENT_HANDLE, + "logging", strlen("logging"), + &object_handle)) { + + objdb->object_create (OBJECT_PARENT_HANDLE, &object_handle, + "logging", strlen("logging")); + } + + objdb->object_key_create(object_handle, "to_stderr", strlen("to_stderr"), + "yes", strlen("yes")+1); + + objdb->object_create (object_handle, &logger_object_handle, + "logger", strlen("logger")); + + objdb->object_key_create(logger_object_handle, "ident", strlen("ident"), + ident, strlen(ident)+1); + objdb->object_key_create(logger_object_handle, "debug", strlen("debug"), + "on", strlen("on")+1); +} +#endif diff --git a/cman/daemon/logging.h b/cman/daemon/logging.h index dcb7932..83ceca2 100644 --- a/cman/daemon/logging.h +++ b/cman/daemon/logging.h @@ -9,7 +9,21 @@ ** ******************************************************************************* ******************************************************************************/ +#ifdef OPENAIS_WHITETANK +#include <openais/service/print.h> +#include <openais/service/objdb.h> + +#define LOGSYS_DECLARE_SUBSYS(subsys,priority) \ +__attribute__ ((constructor)) static void logsys_subsys_init (void) \ +{ \ + log_init(subsys); \ +} +void set_logger_level(struct objdb_iface_ver0 *objdb, char *ident, int level); +#define logsys_config_subsys_set(x,y,z) set_logger_level(global_objdb, x, z) + +#else #include <openais/service/logsys.h> +#endif extern void set_debuglog(int subsystems); @@ -22,7 +36,7 @@ extern void set_debuglog(int subsystems); extern int subsys_mask; -#define P_BARRIER(fmt, args...) if (subsys_mask & CMAN_DEBUG_BARRIER) log_printf(logsys_mkpri(LOG_LEVEL_DEBUG, logsys_subsys_id), "barrier: " fmt, ## args) +#define P_BARRIER(fmt, args...) if (subsys_mask & CMAN_DEBUG_BARRIER) log_printf(LOG_LEVEL_DEBUG , "barrier: " fmt, ## args) #define P_MEMB(fmt, args...) if (subsys_mask & CMAN_DEBUG_MEMB) log_printf(LOG_LEVEL_DEBUG , "memb: " fmt, ## args) #define P_DAEMON(fmt, args...) if (subsys_mask & CMAN_DEBUG_DAEMON) log_printf(LOG_LEVEL_DEBUG , "daemon: " fmt, ## args) #define P_AIS(fmt, args...) if (subsys_mask & CMAN_DEBUG_AIS) log_printf(LOG_LEVEL_DEBUG, "ais " fmt, ## args)