From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22115 invoked by alias); 23 Jun 2008 13:10:43 -0000 Received: (qmail 22083 invoked by uid 9702); 23 Jun 2008 13:10:42 -0000 Date: Mon, 23 Jun 2008 13:10:00 -0000 Message-ID: <20080623131039.22063.qmail@sourceware.org> From: fabbione@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, master, updated. cluster-2.99.04-58-ga2f1025 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 0b8bd69b8f6a393958229551396057ac44ca5391 X-Git-Newrev: a2f1025d6e1595475afcdcd68d6f8205ecf99412 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00531.txt.bz2 This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project". http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=a2f1025d6e1595475afcdcd68d6f8205ecf99412 The branch, master has been updated via a2f1025d6e1595475afcdcd68d6f8205ecf99412 (commit) from 0b8bd69b8f6a393958229551396057ac44ca5391 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a2f1025d6e1595475afcdcd68d6f8205ecf99412 Author: Fabio M. Di Nitto Date: Mon Jun 23 15:09:33 2008 +0200 [MISC] Logging: optimizing query sequence Query for debug info only if nothing is specified on the command line. Signed-off-by: Fabio M. Di Nitto ----------------------------------------------------------------------- Summary of changes: ccs/daemon/misc.c | 65 ++++++++++++++++++++---------------------- cman/qdisk/main.c | 81 +++++++++++++++++++++++++++-------------------------- 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c index acab5c8..76f63de 100644 --- a/ccs/daemon/misc.c +++ b/ccs/daemon/misc.c @@ -166,22 +166,22 @@ int set_ccs_logging(xmlDocPtr ldoc){ logmode = logsys_config_mode_get(); - res = do_simple_xml_query(ctx, "/cluster/logging/@debug"); - if(res) { - if(!strcmp(res, "on")) { - global_debug = 1; - } else - if(!strcmp(res, "off")) { - global_debug = 0; - } else - log_printf(LOG_ERR, "global debug: unknown value\n"); - free(res); - res=NULL; - } + if(!debug) { + res = do_simple_xml_query(ctx, "/cluster/logging/@debug"); + if(res) { + if(!strcmp(res, "on")) { + global_debug = 1; + } else + if(!strcmp(res, "off")) { + global_debug = 0; + } else + log_printf(LOG_ERR, "global debug: unknown value\n"); + free(res); + res=NULL; + } - res = do_simple_xml_query(ctx, "/cluster/logging/logger_subsys[@subsys=\"CCS\"]/@debug"); - if(res) { - if(!debug) { + res = do_simple_xml_query(ctx, "/cluster/logging/logger_subsys[@subsys=\"CCS\"]/@debug"); + if(res) { if(!strcmp(res, "on")) { debug = 1; } else @@ -189,28 +189,25 @@ int set_ccs_logging(xmlDocPtr ldoc){ debug = 0; } else log_printf(LOG_ERR, "subsys debug: unknown value\n"); - } - free(res); - res=NULL; - } else - debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - - if(debug) - logsys_config_priority_set (LOG_LEVEL_DEBUG); + free(res); + res=NULL; + } else + debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - res = do_simple_xml_query(ctx, "/cluster/logging/logger_subsys[@subsys=\"CCS\"]/@syslog_level"); - if(res) { - loglevel = logsys_priority_id_get (res); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + res = do_simple_xml_query(ctx, "/cluster/logging/logger_subsys[@subsys=\"CCS\"]/@syslog_level"); + if(res) { + loglevel = logsys_priority_id_get (res); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - if (!debug) - logsys_config_priority_set (loglevel); + if(!debug) + logsys_config_priority_set (loglevel); - log_printf(LOG_DEBUG, "syslog_level: %s (%d).\n", res, loglevel); - free(res); - res=NULL; - } + free(res); + res=NULL; + } + } else + logsys_config_priority_set (LOG_LEVEL_DEBUG); res = do_simple_xml_query(ctx, "/cluster/logging/@to_stderr"); if(res) { diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c index 466609a..4202508 100644 --- a/cman/qdisk/main.c +++ b/cman/qdisk/main.c @@ -1077,59 +1077,60 @@ get_logsys_config_data(int *debug) logmode = logsys_config_mode_get(); - if (ccs_get(ccsfd, "/cluster/logging/@debug", &val) == 0) { - if(!strcmp(val, "on")) { - global_debug = 1; - } else - if(!strcmp(val, "off")) { - global_debug = 0; - } else - log_printf(LOG_ERR, "global debug: unknown value\n"); - free(val); - val = NULL; - } + if (!debug) { + if (ccs_get(ccsfd, "/cluster/logging/@debug", &val) == 0) { + if(!strcmp(val, "on")) { + global_debug = 1; + } else + if(!strcmp(val, "off")) { + global_debug = 0; + } else + log_printf(LOG_ERR, "global debug: unknown value\n"); + free(val); + val = NULL; + } - if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"QDISK\"]/@debug", &val) == 0) { - if(!*debug) { + if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"QDISK\"]/@debug", &val) == 0) { if(!strcmp(val, "on")) { *debug = 1; } else - if(!strcmp(val, "off") && !*debug) { /* debug from cmdline/envvars override config */ + if(!strcmp(val, "off")) { /* debug from cmdline/envvars override config */ *debug = 0; } else log_printf(LOG_ERR, "subsys debug: unknown value: %s\n", val); - free(val); - val = NULL; - } - } else - *debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ + free(val); + val = NULL; + } else + *debug = global_debug; /* global debug overrides subsystem only if latter is not specified */ - if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"QDISK\"]/@syslog_level", &val) == 0) { - loglevel = logsys_priority_id_get (val); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + if (ccs_get(ccsfd, "/cluster/logging/logger_subsys[@subsys=\"QDISK\"]/@syslog_level", &val) == 0) { + loglevel = logsys_priority_id_get (val); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - if (!*debug) { - *debug = 1; - logsys_config_priority_set (loglevel); - } + if (!*debug) { + *debug = 1; + logsys_config_priority_set (loglevel); + } - free(val); - } else - if (ccs_get(ccsfd, "/cluster/quorumd/@log_level", &val) == 0) { /* check backward compat options */ - loglevel = logsys_priority_id_get (val); - if (loglevel < 0) - loglevel = LOG_LEVEL_INFO; + free(val); + } else + if (ccs_get(ccsfd, "/cluster/quorumd/@log_level", &val) == 0) { /* check backward compat options */ + loglevel = logsys_priority_id_get (val); + if (loglevel < 0) + loglevel = LOG_LEVEL_INFO; - log_printf(LOG_ERR, "