cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c  ...
@ 2007-05-21 10:48 pcaulfield
  0 siblings, 0 replies; 5+ messages in thread
From: pcaulfield @ 2007-05-21 10:48 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-05-21 10:48:43

Modified files:
	cman/daemon    : ais.c barrier.c cmanccs.c commands.c daemon.c 

Log message:
	Add swab.h for compiling against openais trunk

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.48&r2=1.49
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.33&r2=1.34

--- cluster/cman/daemon/ais.c	2007/05/09 16:16:47	1.48
+++ cluster/cman/daemon/ais.c	2007/05/21 10:48:40	1.49
@@ -28,6 +28,7 @@
 #include <netdb.h>
 
 /* openais headers */
+#include <openais/service/swab.h>
 #include <openais/totem/totemip.h>
 #include <openais/totem/totempg.h>
 #include <openais/totem/aispoll.h>
--- cluster/cman/daemon/barrier.c	2006/06/30 13:00:26	1.8
+++ cluster/cman/daemon/barrier.c	2007/05/21 10:48:40	1.9
@@ -30,7 +30,7 @@
 #include <netinet/in.h>
 #include <sys/errno.h>
 
-
+#include <openais/service/swab.h>
 #include <openais/totem/totemip.h>
 #include <openais/totem/aispoll.h>
 #include "list.h"
--- cluster/cman/daemon/cmanccs.c	2007/05/18 10:13:35	1.27
+++ cluster/cman/daemon/cmanccs.c	2007/05/21 10:48:40	1.28
@@ -22,6 +22,8 @@
 #include <netdb.h>
 #include <ifaddrs.h>
 
+#include <openais/service/swab.h>
+
 #include "list.h"
 #include "cnxman-socket.h"
 #include "cnxman-private.h"
--- cluster/cman/daemon/commands.c	2007/05/18 10:13:35	1.62
+++ cluster/cman/daemon/commands.c	2007/05/21 10:48:40	1.63
@@ -30,6 +30,7 @@
 #include <netinet/in.h>
 #include <sys/errno.h>
 
+#include <openais/service/swab.h>
 #include <openais/totem/totemip.h>
 #include <openais/totem/totempg.h>
 #include <openais/service/swab.h>
--- cluster/cman/daemon/daemon.c	2007/01/08 10:07:52	1.33
+++ cluster/cman/daemon/daemon.c	2007/05/21 10:48:40	1.34
@@ -29,6 +29,7 @@
 #include <netinet/in.h>
 #include <sys/errno.h>
 
+#include <openais/service/swab.h>
 #include <openais/totem/aispoll.h>
 #include <openais/totem/totemip.h>
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c  ...
@ 2007-09-17  8:03 pcaulfield
  2007-09-17 20:05 ` Steven Dake
  0 siblings, 1 reply; 5+ messages in thread
From: pcaulfield @ 2007-09-17  8:03 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-09-17 08:03:37

Modified files:
	cman/daemon    : ais.c barrier.c cmanccs.c commands.c daemon.c 
	                 logging.c logging.h 

Log message:
	Use openais logsys functions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.c.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.h.diff?cvsroot=cluster&r1=1.7&r2=1.8

--- cluster/cman/daemon/ais.c	2007/05/21 10:48:40	1.49
+++ cluster/cman/daemon/ais.c	2007/09/17 08:03:36	1.50
@@ -36,7 +36,7 @@
 #include <openais/service/config.h>
 #include <openais/lcr/lcr_comp.h>
 #include <openais/service/swab.h>
-#include <openais/service/print.h>
+#include <openais/service/logsys.h>
 
 #include "cnxman-socket.h"
 #include "commands.h"
@@ -204,9 +204,7 @@
 
 	/* Initialise early logging */
 	if (getenv("CMAN_DEBUGLOG"))
-	{
 		debug_mask = atoi(getenv("CMAN_DEBUGLOG"));
-	}
 
 	if (getenv("CMAN_PIPE"))
 		startup_pipe = atoi(getenv("CMAN_PIPE"));
@@ -242,7 +240,7 @@
 {
 	unsigned int object_handle;
 
-	/* We can only work if our config inerface was run first */
+	/* We can only work if our config interface was run first */
 	if (!config_run)
 		return 0;
 
@@ -269,6 +267,8 @@
 	close(startup_pipe);
 	startup_pipe = 0;
 
+	cman_flush_debuglog();
+
 	/* Start totem */
 	totempg_groups_initialize(&group_handle, cman_deliver_fn, cman_confchg_fn);
 	totempg_groups_join(group_handle, cman_group, 1);
--- cluster/cman/daemon/barrier.c	2007/06/26 09:09:13	1.11
+++ cluster/cman/daemon/barrier.c	2007/09/17 08:03:36	1.12
@@ -240,7 +240,7 @@
 	/* See if it already exists */
 	if ((barrier = find_barrier(name))) {
 		if (nodes != barrier->expected_nodes) {
-			log_msg(LOG_ERR, "Barrier registration failed for '%s', expected nodes=%d, requested=%d\n",
+			log_printf(LOG_ERR, "Barrier registration failed for '%s', expected nodes=%d, requested=%d\n",
 			       name, barrier->expected_nodes, nodes);
 			return -EINVAL;
 		}
--- cluster/cman/daemon/cmanccs.c	2007/08/03 07:35:06	1.29
+++ cluster/cman/daemon/cmanccs.c	2007/09/17 08:03:36	1.30
@@ -102,7 +102,7 @@
     /* Open the config file */
     ctree = ccs_force_connect(NULL, 1);
     if (ctree < 0) {
-	    log_msg(LOG_ERR, "Error connecting to CCS");
+	    log_printf(LOG_ERR, "Error connecting to CCS");
 	    write_cman_pipe("Cannot connect to CCS");
 	    return -1;
     }
@@ -156,7 +156,7 @@
 		char message[132];
 
 		sprintf(message, "No node ID for %s, run 'ccs_tool addnodeids' to fix", nodename);
-		log_msg(LOG_ERR, message);
+		log_printf(LOG_ERR, message);
 		write_cman_pipe(message);
 		return -1;
 	}
@@ -190,7 +190,7 @@
 	   default a multicast address */
         ret = getaddrinfo(nodenames[0], NULL, &ahints, &ainfo);
 	if (ret) {
-		log_msg(LOG_ERR, "Can't determine address family of nodename %s\n", nodenames[0]);
+		log_printf(LOG_ERR, "Can't determine address family of nodename %s\n", nodenames[0]);
 		write_cman_pipe("Can't determine address family of nodename");
 		return NULL;
 	}
@@ -402,12 +402,12 @@
 	/* Connect to ccsd */
 	if (getenv("CMAN_CLUSTER_NAME")) {
 		cname = getenv("CMAN_CLUSTER_NAME");
-		log_msg(LOG_INFO, "Using override cluster name %s\n", cname);
+		log_printf(LOG_INFO, "Using override cluster name %s\n", cname);
 	}
 
 	cd = ccs_force_connect(cname, 1);
 	if (cd < 0) {
-		log_msg(LOG_ERR, "Error connecting to CCS");
+		log_printf(LOG_ERR, "Error connecting to CCS");
 		write_cman_pipe("Can't connect to CCSD");
 		return -ENOTCONN;
 	}
@@ -415,14 +415,14 @@
 	/* Cluster name */
 	error = ccs_get(cd, CLUSTER_NAME_PATH, &str);
 	if (error) {
-		log_msg(LOG_ERR, "cannot find cluster name in config file");
+		log_printf(LOG_ERR, "cannot find cluster name in config file");
 		write_cman_pipe("Can't find cluster name in CCS");
 		return -ENOENT;
 	}
 
 	if (cname) {
 		if (strcmp(cname, str)) {
-			log_msg(LOG_ERR, "cluster names not equal %s %s", cname, str);
+			log_printf(LOG_ERR, "cluster names not equal %s %s", cname, str);
 			write_cman_pipe("Cluster name in CCS does not match that passed to cman_tool");
 			return -ENOENT;
 		}
@@ -445,7 +445,7 @@
 
 	if (getenv("CMAN_NODENAME")) {
 		strcpy(nodename, getenv("CMAN_NODENAME"));
-		log_msg(LOG_INFO, "Using override node name %s\n", nodename);
+		log_printf(LOG_INFO, "Using override node name %s\n", nodename);
 
 		sprintf(path, NODE_NAME_PATH_BYNAME, nodename);
 
@@ -454,7 +454,7 @@
 			free(str);
 		}
 		else {
-			log_msg(LOG_ERR, "Overridden node name %s is not in CCS", nodename);
+			log_printf(LOG_ERR, "Overridden node name %s is not in CCS", nodename);
 			write_cman_pipe("Overridden node name is not in CCS");
 			return -ENOENT;
 		}
@@ -463,7 +463,7 @@
 		struct utsname utsname;
 		error = uname(&utsname);
 		if (error) {
-			log_msg(LOG_ERR, "cannot get node name, uname failed");
+			log_printf(LOG_ERR, "cannot get node name, uname failed");
 			write_cman_pipe("Can't determine local node name");
 			return -ENOENT;
 		}
@@ -474,7 +474,7 @@
 	/* Find our nodename in cluster.conf */
 	error = verify_nodename(cd, nodename);
 	if (error) {
-		log_msg(LOG_ERR, "local node name \"%s\" not found in cluster.conf",
+		log_printf(LOG_ERR, "local node name \"%s\" not found in cluster.conf",
 			nodename);
 		write_cman_pipe("Can't find local node name in cluster.conf");
 		return -ENOENT;
@@ -485,11 +485,11 @@
 	if (getenv("CMAN_EXPECTEDVOTES")) {
 		expected_votes = atoi(getenv("CMAN_EXPECTEDVOTES"));
 		if (expected_votes < 1) {
-			log_msg(LOG_ERR, "CMAN_EXPECTEDVOTES environment variable is invalid, ignoring");
+			log_printf(LOG_ERR, "CMAN_EXPECTEDVOTES environment variable is invalid, ignoring");
 			expected_votes = 0;
 		}
 		else {
-			log_msg(LOG_INFO, "Using override expected votes %d\n", expected_votes);
+			log_printf(LOG_INFO, "Using override expected votes %d\n", expected_votes);
 		}
 	}
 
@@ -515,7 +515,7 @@
 				vote_sum++;
 			else {
 				if (atoi(str) < 0) {
-					log_msg(LOG_ERR, "negative votes not allowed");
+					log_printf(LOG_ERR, "negative votes not allowed");
 					write_cman_pipe("Found negative votes for this node in CCS");
 					return -EINVAL;
 				}
@@ -537,7 +537,7 @@
 	/* optional port */
 	if (getenv("CMAN_IP_PORT")) {
 		port = atoi(getenv("CMAN_IP_PORT"));
-		log_msg(LOG_INFO, "Using override IP port %d\n", port);
+		log_printf(LOG_INFO, "Using override IP port %d\n", port);
 	}
 
 	if (!port) {
@@ -565,7 +565,7 @@
 	/* find our own number of votes */
 	if (getenv("CMAN_VOTES")) {
 		votes = atoi(getenv("CMAN_VOTES"));
-		log_msg(LOG_INFO, "Using override votes %d\n", votes);
+		log_printf(LOG_INFO, "Using override votes %d\n", votes);
 	}
 
 	if (!votes) {
@@ -576,7 +576,7 @@
 		if (!error) {
 			int votestmp = atoi(str);
 			if (votestmp < 0 || votestmp > 255) {
-				log_msg(LOG_ERR, "invalid votes value %d", votes);
+				log_printf(LOG_ERR, "invalid votes value %d", votes);
 				write_cman_pipe("Found invalid votes for node in CCS");
 				return -EINVAL;
 			}
@@ -592,7 +592,7 @@
 	/* nodeid */
 	if (getenv("CMAN_NODEID")) {
 		nodeid = atoi(getenv("CMAN_NODEID"));
-		log_msg(LOG_INFO, "Using override nodeid %d\n", nodeid);
+		log_printf(LOG_INFO, "Using override nodeid %d\n", nodeid);
 	}
 
 	if (!nodeid) {
@@ -607,14 +607,14 @@
 	}
 
 	if (!nodeid) {
-		log_msg(LOG_ERR, "No nodeid specified in cluster.conf");
+		log_printf(LOG_ERR, "No nodeid specified in cluster.conf");
 		write_cman_pipe("CCS does not have a nodeid for this node, run 'ccs_tool addnodeids' to fix");
 		return -EINVAL;
 	}
 
 	if (getenv("CMAN_MCAST_ADDR")) {
 		mcast_name = getenv("CMAN_MCAST_ADDR");
-		log_msg(LOG_INFO, "Using override multicast address %s\n", mcast_name);
+		log_printf(LOG_INFO, "Using override multicast address %s\n", mcast_name);
 	}
 
 	/* Optional multicast name */
@@ -627,7 +627,7 @@
 
 	if (!mcast_name) {
 		mcast_name = default_mcast(cluster_id);
-		log_msg(LOG_INFO, "Using default multicast address of %s\n", mcast_name);
+		log_printf(LOG_INFO, "Using default multicast address of %s\n", mcast_name);
 	}
 
 	mcast[0] = mcast_name;
@@ -678,7 +678,7 @@
 		free(str);
 		if (two_node) {
 			if (node_count != 2 || vote_sum != 2) {
-				log_msg(LOG_ERR, "the two-node option requires exactly two "
+				log_printf(LOG_ERR, "the two-node option requires exactly two "
 					"nodes with one vote each and expected "
 					"votes of 1 (node_count=%d vote_sum=%d)",
 					node_count, vote_sum);
@@ -687,7 +687,7 @@
 			}
 
 			if (votes != 1) {
-				log_msg(LOG_ERR, "the two-node option requires exactly two "
+				log_printf(LOG_ERR, "the two-node option requires exactly two "
 					"nodes with one vote each and expected "
 					"votes of 1 (votes=%d)", votes);
 				write_cman_pipe("two_node set but votes not set to 1");
@@ -710,7 +710,7 @@
 
 	error = get_ccs_join_info();
 	if (error) {
-		log_msg(LOG_ERR, "Error reading CCS info, cannot start");
+		log_printf(LOG_ERR, "Error reading CCS info, cannot start");
 		return error;
 	}
 
--- cluster/cman/daemon/commands.c	2007/09/07 12:17:45	1.70
+++ cluster/cman/daemon/commands.c	2007/09/17 08:03:36	1.71
@@ -34,7 +34,7 @@
 #include <openais/totem/totemip.h>
 #include <openais/totem/totempg.h>
 #include <openais/service/swab.h>
-#include <openais/service/print.h>
+#include <openais/service/logsys.h>
 #include <openais/service/timer.h>
 #include <openais/totem/aispoll.h>
 #include "list.h"
@@ -159,9 +159,9 @@
 	}
 
 	if (cluster_is_quorate && !quorate)
-		log_msg(LOG_INFO, "quorum lost, blocking activity\n");
+		log_printf(LOG_INFO, "quorum lost, blocking activity\n");
 	if (!cluster_is_quorate && quorate)
-		log_msg(LOG_INFO, "quorum regained, resuming activity\n");
+		log_printf(LOG_INFO, "quorum regained, resuming activity\n");
 
 	/* If we are newly quorate, then kill any AISONLY nodes */
 	if (!cluster_is_quorate && quorate) {
@@ -404,7 +404,7 @@
 	ais_running = 1;
 
 	if (read_ccs_nodes(&config_version, 1)) {
-		log_msg(LOG_ERR, "Can't initialise list of nodes from CCS\n");
+		log_printf(LOG_ERR, "Can't initialise list of nodes from CCS\n");
 		return -EINVAL;
 	}
 
@@ -997,7 +997,7 @@
         /* Keep this list valid so it doesn't confuse other code */
         list_init(&quorum_device->addr_list);
 
-	log_msg(LOG_INFO, "quorum device registered\n");
+	log_printf(LOG_INFO, "quorum device registered\n");
         return 0;
 }
 
@@ -1014,7 +1014,7 @@
 
         quorum_device = NULL;
 
-	log_msg(LOG_INFO, "quorum device unregistered\n");
+	log_printf(LOG_INFO, "quorum device unregistered\n");
         return 0;
 }
 
@@ -1022,17 +1022,17 @@
 {
 	int ccs_err;
 
-	log_msg(LOG_DEBUG, "Polling ccsd for updated information\n");
+	log_printf(LOG_DEBUG, "Polling ccsd for updated information\n");
 	ccs_err = read_ccs_nodes(&config_version, 0);
 	if (ccs_err || config_version < wanted_config_version) {
-		log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
-			wanted_config_version);
+		log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
+				wanted_config_version);
 
 		openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
 					   ccsd_timer_fn, &ccsd_timer);
 	}
 	else {
-		log_msg(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
+		log_printf(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
 		config_error = 0;
 		recalculate_quorum(0, 0);
 	}
@@ -1048,7 +1048,7 @@
 	gettimeofday(&now, NULL);
 	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
 		quorum_device->state = NODESTATE_DEAD;
-		log_msg(LOG_INFO, "lost contact with quorum device\n");
+		log_printf(LOG_INFO, "lost contact with quorum device\n");
 		recalculate_quorum(0, 0);
 	}
 	else {
@@ -1478,20 +1478,20 @@
 static int valid_transition_msg(int nodeid, struct cl_transmsg *msg)
 {
 	if (strcmp(msg->clustername, cluster_name) != 0) {
-		log_msg(LOG_ERR, "Node %d conflict, remote cluster name='%s', local='%s'\n",
+		log_printf(LOG_ERR, "Node %d conflict, remote cluster name='%s', local='%s'\n",
 			nodeid, msg->clustername, cluster_name);
 		return -1;
 	}
 
 	if (msg->cluster_id != cluster_id) {
-		log_msg(LOG_ERR, "Node %d conflict, remote cluster id=%d, local=%d\n",
+		log_printf(LOG_ERR, "Node %d conflict, remote cluster id=%d, local=%d\n",
 			nodeid, msg->cluster_id, cluster_id);
 		return -1;
 	}
 
 	if (msg->major_version != CNXMAN_MAJOR_VERSION) {
 
-		log_msg(LOG_ERR, "Node %d conflict, remote version id=%d, local=%d\n",
+		log_printf(LOG_ERR, "Node %d conflict, remote version id=%d, local=%d\n",
 			nodeid, msg->major_version, CNXMAN_MAJOR_VERSION);
 		return -1;
 	}
@@ -1503,7 +1503,7 @@
 		ccs_err = read_ccs_nodes(&config_version, 0);
 		if (ccs_err || config_version < msg->config_version) {
 			config_error = 1;
-			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
+			log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
 				msg->config_version);
 
 			wanted_config_version = msg->config_version;
@@ -1518,7 +1518,7 @@
 
 
 	if (msg->config_version != config_version) {
-		log_msg(LOG_ERR, "Node %d conflict, remote config version id=%d, local=%d\n",
+		log_printf(LOG_ERR, "Node %d conflict, remote config version id=%d, local=%d\n",
 			nodeid, msg->config_version, config_version);
 		return -1;
 	}
@@ -1660,7 +1660,7 @@
 
 	case RECONFIG_PARAM_CONFIG_VERSION:
 		if (read_ccs_nodes(&config_version, 0)) {
-			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
+			log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
 				msg->value);
 
 			config_error = 1;
@@ -1839,7 +1839,7 @@
 
 	case CLUSTER_MSG_PORTSTATUS:
 		if (nodeid != us->node_id) {
-			P_MEMB("got PORTRESULT from %d, low bytes = %x %x\n", data[1], data[2]);
+			P_MEMB("got PORTRESULT from %d, low bytes = %x %x\n", nodeid, data[1], data[2]);
 			if (node)
 				memcpy(node->port_bits, data+1, PORT_BITS_SIZE);
 		}
@@ -1854,7 +1854,7 @@
 		killmsg = (struct cl_killmsg *)data;
 		P_MEMB("got KILL for node %d\n", killmsg->nodeid);
 		if (killmsg->nodeid == wanted_nodeid) {
-			log_msg(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
+			log_printf(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
 				killmsg_reason(killmsg->reason));
 			exit(1);
 		}
@@ -1896,7 +1896,7 @@
 		break;
 
 	default:
-		log_msg(LOG_WARNING, "Unknown protocol message %d received\n", msg->cmd);
+		log_printf(LOG_WARNING, "Unknown protocol message %d received\n", msg->cmd);
 		break;
 
 	}
@@ -1926,11 +1926,11 @@
 	if (totemip_parse(&ipaddr, nodename, 0))
 	{
 		if (!nodeid) {
-			log_msg(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
+			log_printf(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
 			return;
 		}
 		else {
-			log_msg(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
+			log_printf(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
 			memset(&ipaddr, 0, sizeof(ipaddr));
 		}
 	}
@@ -1943,7 +1943,7 @@
 {
 	struct cluster_node *node;
 
-	P_MEMB("add_ais_node ID=%d, incarnation = %d\n",nodeid, incarnation);
+	P_MEMB("add_ais_node ID=%d, incarnation = %lld\n",nodeid, incarnation);
 
 	node = find_node_by_nodeid(nodeid);
 	if (!node && total_members == 1) {
@@ -1956,11 +1956,11 @@
 		char tempname[256];
 		node = malloc(sizeof(struct cluster_node));
 		if (!node) {
-			log_msg(LOG_ERR, "error allocating node struct for id %d, but CCS doesn't know about it anyway\n",
+			log_printf(LOG_ERR, "error allocating node struct for id %d, but CCS doesn't know about it anyway\n",
 				nodeid);
 			return;
 		}
-		log_msg(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
+		log_printf(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
 
 		memset(node, 0, sizeof(struct cluster_node));
 		node_add_ordered(node);
--- cluster/cman/daemon/daemon.c	2007/08/22 08:58:37	1.36
+++ cluster/cman/daemon/daemon.c	2007/09/17 08:03:36	1.37
@@ -337,7 +337,7 @@
 		unlink(name);
 	local_socket = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (local_socket < 0) {
-		log_msg(LOG_ERR, "Can't create local socket %s: %s\n", name, strerror(errno));
+		log_printf(LOG_ERR, "Can't create local socket %s: %s\n", name, strerror(errno));
 		write_cman_pipe("Can't create local cman socket");
 		return -1;
 	}
@@ -349,13 +349,13 @@
 	memcpy(sockaddr.sun_path, name, name_len);
 	sockaddr.sun_family = AF_UNIX;
 	if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
-		log_msg(LOG_ERR, "can't bind local socket to %s: %s\n", name, strerror(errno));
+		log_printf(LOG_ERR, "can't bind local socket to %s: %s\n", name, strerror(errno));
 		write_cman_pipe("Can't bind to local cman socket");
 		close(local_socket);
 		return -1;
 	}
 	if (listen(local_socket, 1) != 0) {
-		log_msg(LOG_ERR, "listen on %s failed: %s\n", name, strerror(errno));
+		log_printf(LOG_ERR, "listen on %s failed: %s\n", name, strerror(errno));
 		write_cman_pipe("listen failed on local cman socket");
 		close(local_socket);
 		return -1;
@@ -366,7 +366,7 @@
 
 	con = malloc(sizeof(struct connection));
 	if (!con) {
-		log_msg(LOG_ERR, "Can't allocate space for local connection: %s\n", strerror(errno));
+		log_printf(LOG_ERR, "Can't allocate space for local connection: %s\n", strerror(errno));
 		write_cman_pipe("malloc failed for connection info");
 		close(local_socket);
 		return -1;
@@ -481,8 +481,8 @@
 	ais_poll_handle = aisexec_poll_handle;
 	barrier_init();
 
-	log_msg(LOG_INFO, "CMAN %s (built %s %s) started\n",
-		RELEASE_VERSION, __DATE__, __TIME__);
+	log_printf(LOG_INFO, "CMAN %s (built %s %s) started\n",
+		   RELEASE_VERSION, __DATE__, __TIME__);
 
 	fd = open_local_sock(CLIENT_SOCKNAME, sizeof(CLIENT_SOCKNAME), 0660, ais_poll_handle, CON_CLIENT);
 	if (fd < 0)
--- cluster/cman/daemon/logging.c	2007/08/28 13:14:10	1.14
+++ cluster/cman/daemon/logging.c	2007/09/17 08:03:36	1.15
@@ -21,32 +21,17 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 
-/* openais header */
-#include <openais/service/print.h>
-
+#include <openais/service/logsys.h>
 #include "logging.h"
 
-/* All logging comes through here so it can be stamped [CMAN] */
-
-static int use_stderr = 0;
+/* Make this global so that all of cman can use the same subsys name */
+unsigned int logsys_subsys_id;
 int subsys_mask = 0;
 
-void log_msg(int priority, char *fmt, ...)
-{
-	va_list va;
-	char log_buf[1024];
-
-	va_start(va, fmt);
-	vsprintf(log_buf, fmt, va);
-	va_end(va);
-	log_printf(priority, log_buf);
-}
-
 void init_debug(int subsystems)
 {
-	log_init("CMAN");
-
-	use_stderr = (subsystems != 0);
+	logsys_subsys_id = _logsys_subsys_create("CMAN", (subsystems?LOG_LEVEL_DEBUG:LOG_LEVEL_WARNING) );
+	logsys_config_mode_set(LOG_MODE_BUFFER_BEFORE_CONFIG | ((subsystems)?LOG_MODE_OUTPUT_STDERR:0));
 	subsys_mask = subsystems;
 }
 
@@ -55,43 +40,8 @@
 	subsys_mask = subsystems;
 }
 
-void log_debug(int subsys, int stamp, const char *fmt, ...)
+
+void cman_flush_debuglog()
 {
-	va_list va;
-	char newfmt[strlen(fmt)+10];
-	char log_buf[1024];
-
-	if (!(subsys_mask & subsys))
-		return;
-
-	if (stamp)
-	{
-		switch(subsys)
-		{
-		case CMAN_DEBUG_MEMB:
-			strcpy(newfmt, "memb: ");
-			break;
-		case CMAN_DEBUG_DAEMON:
-			strcpy(newfmt, "daemon: ");
-			break;
-		case CMAN_DEBUG_BARRIER:
-			strcpy(newfmt, "barrier: ");
-			break;
-		case CMAN_DEBUG_AIS:
-			strcpy(newfmt, "ais: ");
-			break;
-		default:
-			break;
-		}
-	}
-	else
-	{
-		newfmt[0] = '\0';
-	}
-	strcat(newfmt, fmt);
-
-	va_start(va, fmt);
-	vsprintf(log_buf, newfmt, va);
-	log_printf(LOG_LEVEL_DEBUG, log_buf);
-	va_end(va);
+	logsys_config_mode_set(LOG_MODE_FLUSH_AFTER_CONFIG | ((subsys_mask)?LOG_MODE_OUTPUT_STDERR:0));
 }
--- cluster/cman/daemon/logging.h	2007/08/28 13:14:10	1.7
+++ cluster/cman/daemon/logging.h	2007/09/17 08:03:36	1.8
@@ -9,9 +9,9 @@
 **
 *******************************************************************************
 ******************************************************************************/
-
-extern void log_msg(int priority, char *fmt, ...);
+#include <openais/service/logsys.h>
 extern void init_debug(int subsystems);
+extern void cman_flush_debuglog(void);
 extern void set_debuglog(int subsystems);
 
 /* Debug macros */
@@ -21,9 +21,10 @@
 #define CMAN_DEBUG_DAEMON  8
 #define CMAN_DEBUG_AIS    16
 
-extern void log_debug(int subsys, int stamp, const char *fmt, ...);
+extern unsigned int logsys_subsys_id;
+extern int subsys_mask;
 
-#define P_BARRIER(fmt, args...) log_debug(CMAN_DEBUG_BARRIER, 1, fmt, ## args)
-#define P_MEMB(fmt, args...)    log_debug(CMAN_DEBUG_MEMB, 1, fmt, ## args)
-#define P_DAEMON(fmt, args...)  log_debug(CMAN_DEBUG_DAEMON, 1, fmt, ## args)
-#define P_AIS(fmt, args...)     log_debug(CMAN_DEBUG_AIS, 1, fmt, ## args)
+#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_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)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c ...
  2007-09-17  8:03 [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c pcaulfield
@ 2007-09-17 20:05 ` Steven Dake
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Dake @ 2007-09-17 20:05 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Patrick,

I think the usage of this isnt quite right.

You should be suing DECLARE_LOGSYS_SUBSYS in your plugin C files to
declare the CMAN logging system.  Also the use of the config API is a
bit tricky since the executive also uses this same API.  It is designed
to be called by only one subsystem.

Regards
-steve

On Mon, 2007-09-17 at 08:03 +0000, pcaulfield at sourceware.org wrote:
> CVSROOT:	/cvs/cluster
> Module name:	cluster
> Changes by:	pcaulfield at sourceware.org	2007-09-17 08:03:37
> 
> Modified files:
> 	cman/daemon    : ais.c barrier.c cmanccs.c commands.c daemon.c 
> 	                 logging.c logging.h 
> 
> Log message:
> 	Use openais logsys functions.
> 
> Patches:
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.49&r2=1.50
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.29&r2=1.30
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.70&r2=1.71
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.36&r2=1.37
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.c.diff?cvsroot=cluster&r1=1.14&r2=1.15
> http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.h.diff?cvsroot=cluster&r1=1.7&r2=1.8
> 
> --- cluster/cman/daemon/ais.c	2007/05/21 10:48:40	1.49
> +++ cluster/cman/daemon/ais.c	2007/09/17 08:03:36	1.50
> @@ -36,7 +36,7 @@
>  #include <openais/service/config.h>
>  #include <openais/lcr/lcr_comp.h>
>  #include <openais/service/swab.h>
> -#include <openais/service/print.h>
> +#include <openais/service/logsys.h>
>  
>  #include "cnxman-socket.h"
>  #include "commands.h"
> @@ -204,9 +204,7 @@
>  
>  	/* Initialise early logging */
>  	if (getenv("CMAN_DEBUGLOG"))
> -	{
>  		debug_mask = atoi(getenv("CMAN_DEBUGLOG"));
> -	}
>  
>  	if (getenv("CMAN_PIPE"))
>  		startup_pipe = atoi(getenv("CMAN_PIPE"));
> @@ -242,7 +240,7 @@
>  {
>  	unsigned int object_handle;
>  
> -	/* We can only work if our config inerface was run first */
> +	/* We can only work if our config interface was run first */
>  	if (!config_run)
>  		return 0;
>  
> @@ -269,6 +267,8 @@
>  	close(startup_pipe);
>  	startup_pipe = 0;
>  
> +	cman_flush_debuglog();
> +
>  	/* Start totem */
>  	totempg_groups_initialize(&group_handle, cman_deliver_fn, cman_confchg_fn);
>  	totempg_groups_join(group_handle, cman_group, 1);
> --- cluster/cman/daemon/barrier.c	2007/06/26 09:09:13	1.11
> +++ cluster/cman/daemon/barrier.c	2007/09/17 08:03:36	1.12
> @@ -240,7 +240,7 @@
>  	/* See if it already exists */
>  	if ((barrier = find_barrier(name))) {
>  		if (nodes != barrier->expected_nodes) {
> -			log_msg(LOG_ERR, "Barrier registration failed for '%s', expected nodes=%d, requested=%d\n",
> +			log_printf(LOG_ERR, "Barrier registration failed for '%s', expected nodes=%d, requested=%d\n",
>  			       name, barrier->expected_nodes, nodes);
>  			return -EINVAL;
>  		}
> --- cluster/cman/daemon/cmanccs.c	2007/08/03 07:35:06	1.29
> +++ cluster/cman/daemon/cmanccs.c	2007/09/17 08:03:36	1.30
> @@ -102,7 +102,7 @@
>      /* Open the config file */
>      ctree = ccs_force_connect(NULL, 1);
>      if (ctree < 0) {
> -	    log_msg(LOG_ERR, "Error connecting to CCS");
> +	    log_printf(LOG_ERR, "Error connecting to CCS");
>  	    write_cman_pipe("Cannot connect to CCS");
>  	    return -1;
>      }
> @@ -156,7 +156,7 @@
>  		char message[132];
>  
>  		sprintf(message, "No node ID for %s, run 'ccs_tool addnodeids' to fix", nodename);
> -		log_msg(LOG_ERR, message);
> +		log_printf(LOG_ERR, message);
>  		write_cman_pipe(message);
>  		return -1;
>  	}
> @@ -190,7 +190,7 @@
>  	   default a multicast address */
>          ret = getaddrinfo(nodenames[0], NULL, &ahints, &ainfo);
>  	if (ret) {
> -		log_msg(LOG_ERR, "Can't determine address family of nodename %s\n", nodenames[0]);
> +		log_printf(LOG_ERR, "Can't determine address family of nodename %s\n", nodenames[0]);
>  		write_cman_pipe("Can't determine address family of nodename");
>  		return NULL;
>  	}
> @@ -402,12 +402,12 @@
>  	/* Connect to ccsd */
>  	if (getenv("CMAN_CLUSTER_NAME")) {
>  		cname = getenv("CMAN_CLUSTER_NAME");
> -		log_msg(LOG_INFO, "Using override cluster name %s\n", cname);
> +		log_printf(LOG_INFO, "Using override cluster name %s\n", cname);
>  	}
>  
>  	cd = ccs_force_connect(cname, 1);
>  	if (cd < 0) {
> -		log_msg(LOG_ERR, "Error connecting to CCS");
> +		log_printf(LOG_ERR, "Error connecting to CCS");
>  		write_cman_pipe("Can't connect to CCSD");
>  		return -ENOTCONN;
>  	}
> @@ -415,14 +415,14 @@
>  	/* Cluster name */
>  	error = ccs_get(cd, CLUSTER_NAME_PATH, &str);
>  	if (error) {
> -		log_msg(LOG_ERR, "cannot find cluster name in config file");
> +		log_printf(LOG_ERR, "cannot find cluster name in config file");
>  		write_cman_pipe("Can't find cluster name in CCS");
>  		return -ENOENT;
>  	}
>  
>  	if (cname) {
>  		if (strcmp(cname, str)) {
> -			log_msg(LOG_ERR, "cluster names not equal %s %s", cname, str);
> +			log_printf(LOG_ERR, "cluster names not equal %s %s", cname, str);
>  			write_cman_pipe("Cluster name in CCS does not match that passed to cman_tool");
>  			return -ENOENT;
>  		}
> @@ -445,7 +445,7 @@
>  
>  	if (getenv("CMAN_NODENAME")) {
>  		strcpy(nodename, getenv("CMAN_NODENAME"));
> -		log_msg(LOG_INFO, "Using override node name %s\n", nodename);
> +		log_printf(LOG_INFO, "Using override node name %s\n", nodename);
>  
>  		sprintf(path, NODE_NAME_PATH_BYNAME, nodename);
>  
> @@ -454,7 +454,7 @@
>  			free(str);
>  		}
>  		else {
> -			log_msg(LOG_ERR, "Overridden node name %s is not in CCS", nodename);
> +			log_printf(LOG_ERR, "Overridden node name %s is not in CCS", nodename);
>  			write_cman_pipe("Overridden node name is not in CCS");
>  			return -ENOENT;
>  		}
> @@ -463,7 +463,7 @@
>  		struct utsname utsname;
>  		error = uname(&utsname);
>  		if (error) {
> -			log_msg(LOG_ERR, "cannot get node name, uname failed");
> +			log_printf(LOG_ERR, "cannot get node name, uname failed");
>  			write_cman_pipe("Can't determine local node name");
>  			return -ENOENT;
>  		}
> @@ -474,7 +474,7 @@
>  	/* Find our nodename in cluster.conf */
>  	error = verify_nodename(cd, nodename);
>  	if (error) {
> -		log_msg(LOG_ERR, "local node name \"%s\" not found in cluster.conf",
> +		log_printf(LOG_ERR, "local node name \"%s\" not found in cluster.conf",
>  			nodename);
>  		write_cman_pipe("Can't find local node name in cluster.conf");
>  		return -ENOENT;
> @@ -485,11 +485,11 @@
>  	if (getenv("CMAN_EXPECTEDVOTES")) {
>  		expected_votes = atoi(getenv("CMAN_EXPECTEDVOTES"));
>  		if (expected_votes < 1) {
> -			log_msg(LOG_ERR, "CMAN_EXPECTEDVOTES environment variable is invalid, ignoring");
> +			log_printf(LOG_ERR, "CMAN_EXPECTEDVOTES environment variable is invalid, ignoring");
>  			expected_votes = 0;
>  		}
>  		else {
> -			log_msg(LOG_INFO, "Using override expected votes %d\n", expected_votes);
> +			log_printf(LOG_INFO, "Using override expected votes %d\n", expected_votes);
>  		}
>  	}
>  
> @@ -515,7 +515,7 @@
>  				vote_sum++;
>  			else {
>  				if (atoi(str) < 0) {
> -					log_msg(LOG_ERR, "negative votes not allowed");
> +					log_printf(LOG_ERR, "negative votes not allowed");
>  					write_cman_pipe("Found negative votes for this node in CCS");
>  					return -EINVAL;
>  				}
> @@ -537,7 +537,7 @@
>  	/* optional port */
>  	if (getenv("CMAN_IP_PORT")) {
>  		port = atoi(getenv("CMAN_IP_PORT"));
> -		log_msg(LOG_INFO, "Using override IP port %d\n", port);
> +		log_printf(LOG_INFO, "Using override IP port %d\n", port);
>  	}
>  
>  	if (!port) {
> @@ -565,7 +565,7 @@
>  	/* find our own number of votes */
>  	if (getenv("CMAN_VOTES")) {
>  		votes = atoi(getenv("CMAN_VOTES"));
> -		log_msg(LOG_INFO, "Using override votes %d\n", votes);
> +		log_printf(LOG_INFO, "Using override votes %d\n", votes);
>  	}
>  
>  	if (!votes) {
> @@ -576,7 +576,7 @@
>  		if (!error) {
>  			int votestmp = atoi(str);
>  			if (votestmp < 0 || votestmp > 255) {
> -				log_msg(LOG_ERR, "invalid votes value %d", votes);
> +				log_printf(LOG_ERR, "invalid votes value %d", votes);
>  				write_cman_pipe("Found invalid votes for node in CCS");
>  				return -EINVAL;
>  			}
> @@ -592,7 +592,7 @@
>  	/* nodeid */
>  	if (getenv("CMAN_NODEID")) {
>  		nodeid = atoi(getenv("CMAN_NODEID"));
> -		log_msg(LOG_INFO, "Using override nodeid %d\n", nodeid);
> +		log_printf(LOG_INFO, "Using override nodeid %d\n", nodeid);
>  	}
>  
>  	if (!nodeid) {
> @@ -607,14 +607,14 @@
>  	}
>  
>  	if (!nodeid) {
> -		log_msg(LOG_ERR, "No nodeid specified in cluster.conf");
> +		log_printf(LOG_ERR, "No nodeid specified in cluster.conf");
>  		write_cman_pipe("CCS does not have a nodeid for this node, run 'ccs_tool addnodeids' to fix");
>  		return -EINVAL;
>  	}
>  
>  	if (getenv("CMAN_MCAST_ADDR")) {
>  		mcast_name = getenv("CMAN_MCAST_ADDR");
> -		log_msg(LOG_INFO, "Using override multicast address %s\n", mcast_name);
> +		log_printf(LOG_INFO, "Using override multicast address %s\n", mcast_name);
>  	}
>  
>  	/* Optional multicast name */
> @@ -627,7 +627,7 @@
>  
>  	if (!mcast_name) {
>  		mcast_name = default_mcast(cluster_id);
> -		log_msg(LOG_INFO, "Using default multicast address of %s\n", mcast_name);
> +		log_printf(LOG_INFO, "Using default multicast address of %s\n", mcast_name);
>  	}
>  
>  	mcast[0] = mcast_name;
> @@ -678,7 +678,7 @@
>  		free(str);
>  		if (two_node) {
>  			if (node_count != 2 || vote_sum != 2) {
> -				log_msg(LOG_ERR, "the two-node option requires exactly two "
> +				log_printf(LOG_ERR, "the two-node option requires exactly two "
>  					"nodes with one vote each and expected "
>  					"votes of 1 (node_count=%d vote_sum=%d)",
>  					node_count, vote_sum);
> @@ -687,7 +687,7 @@
>  			}
>  
>  			if (votes != 1) {
> -				log_msg(LOG_ERR, "the two-node option requires exactly two "
> +				log_printf(LOG_ERR, "the two-node option requires exactly two "
>  					"nodes with one vote each and expected "
>  					"votes of 1 (votes=%d)", votes);
>  				write_cman_pipe("two_node set but votes not set to 1");
> @@ -710,7 +710,7 @@
>  
>  	error = get_ccs_join_info();
>  	if (error) {
> -		log_msg(LOG_ERR, "Error reading CCS info, cannot start");
> +		log_printf(LOG_ERR, "Error reading CCS info, cannot start");
>  		return error;
>  	}
>  
> --- cluster/cman/daemon/commands.c	2007/09/07 12:17:45	1.70
> +++ cluster/cman/daemon/commands.c	2007/09/17 08:03:36	1.71
> @@ -34,7 +34,7 @@
>  #include <openais/totem/totemip.h>
>  #include <openais/totem/totempg.h>
>  #include <openais/service/swab.h>
> -#include <openais/service/print.h>
> +#include <openais/service/logsys.h>
>  #include <openais/service/timer.h>
>  #include <openais/totem/aispoll.h>
>  #include "list.h"
> @@ -159,9 +159,9 @@
>  	}
>  
>  	if (cluster_is_quorate && !quorate)
> -		log_msg(LOG_INFO, "quorum lost, blocking activity\n");
> +		log_printf(LOG_INFO, "quorum lost, blocking activity\n");
>  	if (!cluster_is_quorate && quorate)
> -		log_msg(LOG_INFO, "quorum regained, resuming activity\n");
> +		log_printf(LOG_INFO, "quorum regained, resuming activity\n");
>  
>  	/* If we are newly quorate, then kill any AISONLY nodes */
>  	if (!cluster_is_quorate && quorate) {
> @@ -404,7 +404,7 @@
>  	ais_running = 1;
>  
>  	if (read_ccs_nodes(&config_version, 1)) {
> -		log_msg(LOG_ERR, "Can't initialise list of nodes from CCS\n");
> +		log_printf(LOG_ERR, "Can't initialise list of nodes from CCS\n");
>  		return -EINVAL;
>  	}
>  
> @@ -997,7 +997,7 @@
>          /* Keep this list valid so it doesn't confuse other code */
>          list_init(&quorum_device->addr_list);
>  
> -	log_msg(LOG_INFO, "quorum device registered\n");
> +	log_printf(LOG_INFO, "quorum device registered\n");
>          return 0;
>  }
>  
> @@ -1014,7 +1014,7 @@
>  
>          quorum_device = NULL;
>  
> -	log_msg(LOG_INFO, "quorum device unregistered\n");
> +	log_printf(LOG_INFO, "quorum device unregistered\n");
>          return 0;
>  }
>  
> @@ -1022,17 +1022,17 @@
>  {
>  	int ccs_err;
>  
> -	log_msg(LOG_DEBUG, "Polling ccsd for updated information\n");
> +	log_printf(LOG_DEBUG, "Polling ccsd for updated information\n");
>  	ccs_err = read_ccs_nodes(&config_version, 0);
>  	if (ccs_err || config_version < wanted_config_version) {
> -		log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
> -			wanted_config_version);
> +		log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
> +				wanted_config_version);
>  
>  		openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
>  					   ccsd_timer_fn, &ccsd_timer);
>  	}
>  	else {
> -		log_msg(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
> +		log_printf(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
>  		config_error = 0;
>  		recalculate_quorum(0, 0);
>  	}
> @@ -1048,7 +1048,7 @@
>  	gettimeofday(&now, NULL);
>  	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
>  		quorum_device->state = NODESTATE_DEAD;
> -		log_msg(LOG_INFO, "lost contact with quorum device\n");
> +		log_printf(LOG_INFO, "lost contact with quorum device\n");
>  		recalculate_quorum(0, 0);
>  	}
>  	else {
> @@ -1478,20 +1478,20 @@
>  static int valid_transition_msg(int nodeid, struct cl_transmsg *msg)
>  {
>  	if (strcmp(msg->clustername, cluster_name) != 0) {
> -		log_msg(LOG_ERR, "Node %d conflict, remote cluster name='%s', local='%s'\n",
> +		log_printf(LOG_ERR, "Node %d conflict, remote cluster name='%s', local='%s'\n",
>  			nodeid, msg->clustername, cluster_name);
>  		return -1;
>  	}
>  
>  	if (msg->cluster_id != cluster_id) {
> -		log_msg(LOG_ERR, "Node %d conflict, remote cluster id=%d, local=%d\n",
> +		log_printf(LOG_ERR, "Node %d conflict, remote cluster id=%d, local=%d\n",
>  			nodeid, msg->cluster_id, cluster_id);
>  		return -1;
>  	}
>  
>  	if (msg->major_version != CNXMAN_MAJOR_VERSION) {
>  
> -		log_msg(LOG_ERR, "Node %d conflict, remote version id=%d, local=%d\n",
> +		log_printf(LOG_ERR, "Node %d conflict, remote version id=%d, local=%d\n",
>  			nodeid, msg->major_version, CNXMAN_MAJOR_VERSION);
>  		return -1;
>  	}
> @@ -1503,7 +1503,7 @@
>  		ccs_err = read_ccs_nodes(&config_version, 0);
>  		if (ccs_err || config_version < msg->config_version) {
>  			config_error = 1;
> -			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
> +			log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
>  				msg->config_version);
>  
>  			wanted_config_version = msg->config_version;
> @@ -1518,7 +1518,7 @@
>  
> 
>  	if (msg->config_version != config_version) {
> -		log_msg(LOG_ERR, "Node %d conflict, remote config version id=%d, local=%d\n",
> +		log_printf(LOG_ERR, "Node %d conflict, remote config version id=%d, local=%d\n",
>  			nodeid, msg->config_version, config_version);
>  		return -1;
>  	}
> @@ -1660,7 +1660,7 @@
>  
>  	case RECONFIG_PARAM_CONFIG_VERSION:
>  		if (read_ccs_nodes(&config_version, 0)) {
> -			log_msg(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
> +			log_printf(LOG_ERR, "Can't read CCS to get updated config version %d. Activity suspended on this node\n",
>  				msg->value);
>  
>  			config_error = 1;
> @@ -1839,7 +1839,7 @@
>  
>  	case CLUSTER_MSG_PORTSTATUS:
>  		if (nodeid != us->node_id) {
> -			P_MEMB("got PORTRESULT from %d, low bytes = %x %x\n", data[1], data[2]);
> +			P_MEMB("got PORTRESULT from %d, low bytes = %x %x\n", nodeid, data[1], data[2]);
>  			if (node)
>  				memcpy(node->port_bits, data+1, PORT_BITS_SIZE);
>  		}
> @@ -1854,7 +1854,7 @@
>  		killmsg = (struct cl_killmsg *)data;
>  		P_MEMB("got KILL for node %d\n", killmsg->nodeid);
>  		if (killmsg->nodeid == wanted_nodeid) {
> -			log_msg(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
> +			log_printf(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
>  				killmsg_reason(killmsg->reason));
>  			exit(1);
>  		}
> @@ -1896,7 +1896,7 @@
>  		break;
>  
>  	default:
> -		log_msg(LOG_WARNING, "Unknown protocol message %d received\n", msg->cmd);
> +		log_printf(LOG_WARNING, "Unknown protocol message %d received\n", msg->cmd);
>  		break;
>  
>  	}
> @@ -1926,11 +1926,11 @@
>  	if (totemip_parse(&ipaddr, nodename, 0))
>  	{
>  		if (!nodeid) {
> -			log_msg(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
> +			log_printf(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
>  			return;
>  		}
>  		else {
> -			log_msg(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
> +			log_printf(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
>  			memset(&ipaddr, 0, sizeof(ipaddr));
>  		}
>  	}
> @@ -1943,7 +1943,7 @@
>  {
>  	struct cluster_node *node;
>  
> -	P_MEMB("add_ais_node ID=%d, incarnation = %d\n",nodeid, incarnation);
> +	P_MEMB("add_ais_node ID=%d, incarnation = %lld\n",nodeid, incarnation);
>  
>  	node = find_node_by_nodeid(nodeid);
>  	if (!node && total_members == 1) {
> @@ -1956,11 +1956,11 @@
>  		char tempname[256];
>  		node = malloc(sizeof(struct cluster_node));
>  		if (!node) {
> -			log_msg(LOG_ERR, "error allocating node struct for id %d, but CCS doesn't know about it anyway\n",
> +			log_printf(LOG_ERR, "error allocating node struct for id %d, but CCS doesn't know about it anyway\n",
>  				nodeid);
>  			return;
>  		}
> -		log_msg(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
> +		log_printf(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
>  
>  		memset(node, 0, sizeof(struct cluster_node));
>  		node_add_ordered(node);
> --- cluster/cman/daemon/daemon.c	2007/08/22 08:58:37	1.36
> +++ cluster/cman/daemon/daemon.c	2007/09/17 08:03:36	1.37
> @@ -337,7 +337,7 @@
>  		unlink(name);
>  	local_socket = socket(PF_UNIX, SOCK_STREAM, 0);
>  	if (local_socket < 0) {
> -		log_msg(LOG_ERR, "Can't create local socket %s: %s\n", name, strerror(errno));
> +		log_printf(LOG_ERR, "Can't create local socket %s: %s\n", name, strerror(errno));
>  		write_cman_pipe("Can't create local cman socket");
>  		return -1;
>  	}
> @@ -349,13 +349,13 @@
>  	memcpy(sockaddr.sun_path, name, name_len);
>  	sockaddr.sun_family = AF_UNIX;
>  	if (bind(local_socket, (struct sockaddr *) &sockaddr, sizeof(sockaddr))) {
> -		log_msg(LOG_ERR, "can't bind local socket to %s: %s\n", name, strerror(errno));
> +		log_printf(LOG_ERR, "can't bind local socket to %s: %s\n", name, strerror(errno));
>  		write_cman_pipe("Can't bind to local cman socket");
>  		close(local_socket);
>  		return -1;
>  	}
>  	if (listen(local_socket, 1) != 0) {
> -		log_msg(LOG_ERR, "listen on %s failed: %s\n", name, strerror(errno));
> +		log_printf(LOG_ERR, "listen on %s failed: %s\n", name, strerror(errno));
>  		write_cman_pipe("listen failed on local cman socket");
>  		close(local_socket);
>  		return -1;
> @@ -366,7 +366,7 @@
>  
>  	con = malloc(sizeof(struct connection));
>  	if (!con) {
> -		log_msg(LOG_ERR, "Can't allocate space for local connection: %s\n", strerror(errno));
> +		log_printf(LOG_ERR, "Can't allocate space for local connection: %s\n", strerror(errno));
>  		write_cman_pipe("malloc failed for connection info");
>  		close(local_socket);
>  		return -1;
> @@ -481,8 +481,8 @@
>  	ais_poll_handle = aisexec_poll_handle;
>  	barrier_init();
>  
> -	log_msg(LOG_INFO, "CMAN %s (built %s %s) started\n",
> -		RELEASE_VERSION, __DATE__, __TIME__);
> +	log_printf(LOG_INFO, "CMAN %s (built %s %s) started\n",
> +		   RELEASE_VERSION, __DATE__, __TIME__);
>  
>  	fd = open_local_sock(CLIENT_SOCKNAME, sizeof(CLIENT_SOCKNAME), 0660, ais_poll_handle, CON_CLIENT);
>  	if (fd < 0)
> --- cluster/cman/daemon/logging.c	2007/08/28 13:14:10	1.14
> +++ cluster/cman/daemon/logging.c	2007/09/17 08:03:36	1.15
> @@ -21,32 +21,17 @@
>  #include <sys/socket.h>
>  #include <netinet/in.h>
>  
> -/* openais header */
> -#include <openais/service/print.h>
> -
> +#include <openais/service/logsys.h>
>  #include "logging.h"
>  
> -/* All logging comes through here so it can be stamped [CMAN] */
> -
> -static int use_stderr = 0;
> +/* Make this global so that all of cman can use the same subsys name */
> +unsigned int logsys_subsys_id;
>  int subsys_mask = 0;
>  
> -void log_msg(int priority, char *fmt, ...)
> -{
> -	va_list va;
> -	char log_buf[1024];
> -
> -	va_start(va, fmt);
> -	vsprintf(log_buf, fmt, va);
> -	va_end(va);
> -	log_printf(priority, log_buf);
> -}
> -
>  void init_debug(int subsystems)
>  {
> -	log_init("CMAN");
> -
> -	use_stderr = (subsystems != 0);
> +	logsys_subsys_id = _logsys_subsys_create("CMAN", (subsystems?LOG_LEVEL_DEBUG:LOG_LEVEL_WARNING) );
> +	logsys_config_mode_set(LOG_MODE_BUFFER_BEFORE_CONFIG | ((subsystems)?LOG_MODE_OUTPUT_STDERR:0));
>  	subsys_mask = subsystems;
>  }
>  
> @@ -55,43 +40,8 @@
>  	subsys_mask = subsystems;
>  }
>  
> -void log_debug(int subsys, int stamp, const char *fmt, ...)
> +
> +void cman_flush_debuglog()
>  {
> -	va_list va;
> -	char newfmt[strlen(fmt)+10];
> -	char log_buf[1024];
> -
> -	if (!(subsys_mask & subsys))
> -		return;
> -
> -	if (stamp)
> -	{
> -		switch(subsys)
> -		{
> -		case CMAN_DEBUG_MEMB:
> -			strcpy(newfmt, "memb: ");
> -			break;
> -		case CMAN_DEBUG_DAEMON:
> -			strcpy(newfmt, "daemon: ");
> -			break;
> -		case CMAN_DEBUG_BARRIER:
> -			strcpy(newfmt, "barrier: ");
> -			break;
> -		case CMAN_DEBUG_AIS:
> -			strcpy(newfmt, "ais: ");
> -			break;
> -		default:
> -			break;
> -		}
> -	}
> -	else
> -	{
> -		newfmt[0] = '\0';
> -	}
> -	strcat(newfmt, fmt);
> -
> -	va_start(va, fmt);
> -	vsprintf(log_buf, newfmt, va);
> -	log_printf(LOG_LEVEL_DEBUG, log_buf);
> -	va_end(va);
> +	logsys_config_mode_set(LOG_MODE_FLUSH_AFTER_CONFIG | ((subsys_mask)?LOG_MODE_OUTPUT_STDERR:0));
>  }
> --- cluster/cman/daemon/logging.h	2007/08/28 13:14:10	1.7
> +++ cluster/cman/daemon/logging.h	2007/09/17 08:03:36	1.8
> @@ -9,9 +9,9 @@
>  **
>  *******************************************************************************
>  ******************************************************************************/
> -
> -extern void log_msg(int priority, char *fmt, ...);
> +#include <openais/service/logsys.h>
>  extern void init_debug(int subsystems);
> +extern void cman_flush_debuglog(void);
>  extern void set_debuglog(int subsystems);
>  
>  /* Debug macros */
> @@ -21,9 +21,10 @@
>  #define CMAN_DEBUG_DAEMON  8
>  #define CMAN_DEBUG_AIS    16
>  
> -extern void log_debug(int subsys, int stamp, const char *fmt, ...);
> +extern unsigned int logsys_subsys_id;
> +extern int subsys_mask;
>  
> -#define P_BARRIER(fmt, args...) log_debug(CMAN_DEBUG_BARRIER, 1, fmt, ## args)
> -#define P_MEMB(fmt, args...)    log_debug(CMAN_DEBUG_MEMB, 1, fmt, ## args)
> -#define P_DAEMON(fmt, args...)  log_debug(CMAN_DEBUG_DAEMON, 1, fmt, ## args)
> -#define P_AIS(fmt, args...)     log_debug(CMAN_DEBUG_AIS, 1, fmt, ## args)
> +#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_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)
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c  ...
@ 2007-10-03 10:06 pcaulfield
  0 siblings, 0 replies; 5+ messages in thread
From: pcaulfield @ 2007-10-03 10:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-10-03 10:06:21

Modified files:
	cman/daemon    : ais.c barrier.c cmanccs.c commands.c config.c 
	                 daemon.c logging.c logging.h 

Log message:
	Tidy logsys use.
	Is this OK now Steve ?

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.72&r2=1.73
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/config.c.diff?cvsroot=cluster&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.c.diff?cvsroot=cluster&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.h.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- cluster/cman/daemon/ais.c	2007/10/01 12:36:58	1.51
+++ cluster/cman/daemon/ais.c	2007/10/03 10:06:21	1.52
@@ -71,6 +71,8 @@
         { .group          = "CMAN", .group_len      = 4},
 };
 
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+
 /* This structure is tacked onto the start of a cluster message packet for our
  * own nefarious purposes. */
 struct cl_protheader {
@@ -209,13 +211,17 @@
 	if (getenv("CMAN_PIPE"))
 		startup_pipe = atoi(getenv("CMAN_PIPE"));
 
-	init_debug(debug_mask);
+	set_debuglog(debug_mask);
 
 	/* We need to set this up to internal defaults too early */
 	openlog("openais", LOG_CONS|LOG_PID, LOG_LOCAL4);
 
 	global_objdb = objdb;
 
+	/* Enable stderr logging if requested by cman_tool */
+	if (debug_mask)
+		logsys_config_subsys_set("CMAN", LOGSYS_TAG_LOG, LOG_DEBUG);
+
 	/* Read low-level totem/aisexec etc config from CCS */
 	init_config(objdb);
 
@@ -256,7 +262,7 @@
 		if (!getenv("CMAN_DEBUGLOG"))
 		{
 			objdb_get_int(objdb, object_handle, "debug_mask", &debug_mask);
-			init_debug(debug_mask);
+			set_debuglog(debug_mask);
 		}
 	}
 
@@ -267,8 +273,6 @@
 	close(startup_pipe);
 	startup_pipe = 0;
 
-	cman_flush_debuglog();
-
 	/* Start totem */
 	totempg_groups_initialize(&group_handle, cman_deliver_fn, cman_confchg_fn);
 	totempg_groups_join(group_handle, cman_group, 1);
--- cluster/cman/daemon/barrier.c	2007/09/17 08:03:36	1.12
+++ cluster/cman/daemon/barrier.c	2007/10/03 10:06:21	1.13
@@ -45,6 +45,8 @@
 
 extern int we_are_a_cluster_member;
 
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+
 /* A barrier */
 struct cl_barrier {
 	struct list list;
--- cluster/cman/daemon/cmanccs.c	2007/09/17 08:03:36	1.30
+++ cluster/cman/daemon/cmanccs.c	2007/10/03 10:06:21	1.31
@@ -71,6 +71,8 @@
 static unsigned short cluster_id;
 static char cluster_name[MAX_CLUSTER_NAME_LEN + 1];
 
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+
 static uint16_t generate_cluster_id(char *name)
 {
 	int i;
--- cluster/cman/daemon/commands.c	2007/09/27 09:01:30	1.72
+++ cluster/cman/daemon/commands.c	2007/10/03 10:06:21	1.73
@@ -48,6 +48,7 @@
 #include "ais.h"
 
 #define max(a,b) (((a) > (b)) ? (a) : (b))
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
 
 /* Reference counting for cluster applications */
 static int use_count;
--- cluster/cman/daemon/config.c	2006/08/15 13:43:12	1.18
+++ cluster/cman/daemon/config.c	2007/10/03 10:06:21	1.19
@@ -18,6 +18,8 @@
 #include "ccs.h"
 #include "logging.h"
 
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+
 static int read_config_for(int ccs_fd, struct objdb_iface_ver0 *objdb, unsigned int parent,
 			   char *object, char *key, int always_create)
 {
--- cluster/cman/daemon/daemon.c	2007/09/17 08:03:36	1.37
+++ cluster/cman/daemon/daemon.c	2007/10/03 10:06:21	1.38
@@ -42,6 +42,8 @@
 #include "barrier.h"
 #include "ais.h"
 
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+
 struct queued_reply
 {
 	struct list list;
--- cluster/cman/daemon/logging.c	2007/09/19 12:49:37	1.16
+++ cluster/cman/daemon/logging.c	2007/10/03 10:06:21	1.17
@@ -24,24 +24,11 @@
 #include <openais/service/logsys.h>
 #include "logging.h"
 
-/* Make this global so that all of cman can use the same subsys name */
-unsigned int logsys_subsys_id;
-int subsys_mask = 0;
+LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
 
-void init_debug(int subsystems)
-{
-	logsys_subsys_id = logsys_config_subsys_set ("CMAN", LOGSYS_TAG_LOG, (subsystems?LOG_LEVEL_DEBUG:LOG_LEVEL_WARNING) );
-	logsys_config_mode_set(LOG_MODE_BUFFER_BEFORE_CONFIG | ((subsystems)?LOG_MODE_OUTPUT_STDERR:0));
-	subsys_mask = subsystems;
-}
+int subsys_mask = 0;
 
 void set_debuglog(int subsystems)
 {
 	subsys_mask = subsystems;
 }
-
-
-void cman_flush_debuglog()
-{
-	logsys_config_mode_set(LOG_MODE_FLUSH_AFTER_CONFIG | ((subsys_mask)?LOG_MODE_OUTPUT_STDERR:0));
-}
--- cluster/cman/daemon/logging.h	2007/09/17 08:03:36	1.8
+++ cluster/cman/daemon/logging.h	2007/10/03 10:06:21	1.9
@@ -10,8 +10,7 @@
 *******************************************************************************
 ******************************************************************************/
 #include <openais/service/logsys.h>
-extern void init_debug(int subsystems);
-extern void cman_flush_debuglog(void);
+
 extern void set_debuglog(int subsystems);
 
 /* Debug macros */
@@ -21,7 +20,6 @@
 #define CMAN_DEBUG_DAEMON  8
 #define CMAN_DEBUG_AIS    16
 
-extern unsigned int logsys_subsys_id;
 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)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c  ...
@ 2008-01-02 16:35 pcaulfield
  0 siblings, 0 replies; 5+ messages in thread
From: pcaulfield @ 2008-01-02 16:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-01-02 16:35:44

Modified files:
	cman/daemon    : ais.c barrier.c cmanccs.c commands.c config.c 
	                 daemon.c logging.c 

Log message:
	Use define CMAN_NAME for the purpose for which it was intended

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/ais.c.diff?cvsroot=cluster&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/barrier.c.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/cmanccs.c.diff?cvsroot=cluster&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.79&r2=1.80
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/config.c.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/daemon.c.diff?cvsroot=cluster&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/logging.c.diff?cvsroot=cluster&r1=1.17&r2=1.18

--- cluster/cman/daemon/ais.c	2007/12/31 05:15:43	1.58
+++ cluster/cman/daemon/ais.c	2008/01/02 16:35:44	1.59
@@ -39,7 +39,9 @@
 #include <openais/service/swab.h>
 #include <openais/service/logsys.h>
 
+#include "list.h"
 #include "cnxman-socket.h"
+#include "cnxman-private.h"
 #include "commands.h"
 #include "logging.h"
 
@@ -71,7 +73,7 @@
         { .group          = "CMAN", .group_len      = 4},
 };
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 /* This structure is tacked onto the start of a cluster message packet for our
  * own nefarious purposes. */
@@ -220,7 +222,7 @@
 
 	/* Enable stderr logging if requested by cman_tool */
 	if (debug_mask)
-		logsys_config_subsys_set("CMAN", LOGSYS_TAG_LOG, LOG_DEBUG);
+		logsys_config_subsys_set(CMAN_NAME, LOGSYS_TAG_LOG, LOG_DEBUG);
 
 	/* Read low-level totem/aisexec etc config from CCS */
 	init_config(objdb);
@@ -584,7 +586,7 @@
 		objdb->object_create(object_handle, &logger_object_handle,
 				      "logger_subsys", strlen("logger_subsys"));
 		objdb->object_key_create(logger_object_handle, "subsys", strlen("subsys"),
-					 "CMAN", strlen("CMAN")+1);
+					 CMAN_NAME, strlen(CMAN_NAME)+1);
 
 		if (debug_mask) {
 			objdb->object_key_create(logger_object_handle, "debug", strlen("debug"),
--- cluster/cman/daemon/barrier.c	2007/10/03 10:06:21	1.13
+++ cluster/cman/daemon/barrier.c	2008/01/02 16:35:44	1.14
@@ -45,7 +45,7 @@
 
 extern int we_are_a_cluster_member;
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 /* A barrier */
 struct cl_barrier {
--- cluster/cman/daemon/cmanccs.c	2007/11/29 11:19:12	1.38
+++ cluster/cman/daemon/cmanccs.c	2008/01/02 16:35:44	1.39
@@ -73,7 +73,7 @@
 static unsigned short cluster_id;
 static char cluster_name[MAX_CLUSTER_NAME_LEN + 1];
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 static uint16_t generate_cluster_id(char *name)
 {
--- cluster/cman/daemon/commands.c	2008/01/02 16:23:28	1.79
+++ cluster/cman/daemon/commands.c	2008/01/02 16:35:44	1.80
@@ -48,7 +48,7 @@
 #include "ais.h"
 
 #define max(a,b) (((a) > (b)) ? (a) : (b))
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 /* Reference counting for cluster applications */
 static int use_count;
--- cluster/cman/daemon/config.c	2007/10/03 10:06:21	1.19
+++ cluster/cman/daemon/config.c	2008/01/02 16:35:44	1.20
@@ -12,13 +12,18 @@
 ******************************************************************************/
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
+#include <netinet/in.h>
 
 #include <openais/service/objdb.h>
+#include "list.h"
+#include "cnxman-socket.h"
+#include "cnxman-private.h"
 #include "ccs.h"
 #include "logging.h"
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 static int read_config_for(int ccs_fd, struct objdb_iface_ver0 *objdb, unsigned int parent,
 			   char *object, char *key, int always_create)
--- cluster/cman/daemon/daemon.c	2007/10/03 10:06:21	1.38
+++ cluster/cman/daemon/daemon.c	2008/01/02 16:35:44	1.39
@@ -42,7 +42,7 @@
 #include "barrier.h"
 #include "ais.h"
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 struct queued_reply
 {
--- cluster/cman/daemon/logging.c	2007/10/03 10:06:21	1.17
+++ cluster/cman/daemon/logging.c	2008/01/02 16:35:44	1.18
@@ -22,9 +22,12 @@
 #include <netinet/in.h>
 
 #include <openais/service/logsys.h>
+#include "list.h"
+#include "cnxman-socket.h"
+#include "cnxman-private.h"
 #include "logging.h"
 
-LOGSYS_DECLARE_SUBSYS ("CMAN", LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
 
 int subsys_mask = 0;
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-02 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-17  8:03 [Cluster-devel] cluster/cman/daemon ais.c barrier.c cmanccs.c pcaulfield
2007-09-17 20:05 ` Steven Dake
  -- strict thread matches above, loose matches on Subject: below --
2008-01-02 16:35 pcaulfield
2007-10-03 10:06 pcaulfield
2007-05-21 10:48 pcaulfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).