WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xenconsoled: setlogmask takes a bitmask, not a value

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xenconsoled: setlogmask takes a bitmask, not a value
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 16 Jul 2010 10:07:53 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 16 Jul 2010 02:08:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Before this patch only log messages with precisely priority
LOG_WARNING (or precisely LOG_DEBUG if -v) would be logged.

xenconsoled only actually logs using LOG_ERR and LOG_DEBUG so for the
most part we would have been logging absolutely nothing up until now.

Linux provides a LOG_UPTO macro but I'm not sure how portable that is
so I have opencoded the list of levels.

Do I get some sort of prize for fixing a bug introduced in 2005?

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 6c71d1364ef9 -r 64c1878a9c37 tools/console/daemon/main.c
--- a/tools/console/daemon/main.c       Fri Jul 16 09:56:39 2010 +0100
+++ b/tools/console/daemon/main.c       Fri Jul 16 10:07:47 2010 +0100
@@ -73,7 +73,8 @@
        bool is_interactive = false;
        int ch;
        int syslog_option = LOG_CONS;
-       int syslog_mask = LOG_WARNING;
+       int syslog_mask = 
LOG_MASK(LOG_WARNING)|LOG_MASK(LOG_ERR)|LOG_MASK(LOG_CRIT)|\
+                         LOG_MASK(LOG_ALERT)|LOG_MASK(LOG_EMERG);
        int opt_ind = 0;
        char *pidfile = NULL;
 
@@ -89,7 +90,8 @@
 #ifndef __sun__
                        syslog_option |= LOG_PERROR;
 #endif
-                       syslog_mask = LOG_DEBUG;
+                       syslog_mask |= LOG_MASK(LOG_NOTICE)|LOG_MASK(LOG_INFO)| 
\
+                                     LOG_MASK(LOG_DEBUG);
                        break;
                case 'i':
                        is_interactive = true;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xenconsoled: setlogmask takes a bitmask, not a value, Ian Campbell <=