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-changelog

[Xen-changelog] [xen-unstable] xl: correct calls to dolog() (aka LOG)

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: correct calls to dolog() (aka LOG)
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Sep 2010 14:40:30 -0700
Delivery-date: Fri, 10 Sep 2010 14:45:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1283960140 -3600
# Node ID 9d6fcb72ae5f24704c592e3600b6f406c80dec7f
# Parent  fc866633d0ebb7b0982c5d5ddd62d3a7a70e6d5b
xl: correct calls to dolog() (aka LOG)

dolog, for which LOG is a macro wrapper, was lacking the printf format
attribute.  Add it, and fix the two problems revealed.

(Original patch for one of the occurrences from Ian Campbell.)

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r fc866633d0eb -r 9d6fcb72ae5f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Sep 08 16:24:20 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Wed Sep 08 16:35:40 2010 +0100
@@ -235,6 +235,9 @@ static void find_domain(const char *p)
 }
 
 #define LOG(_f, _a...)   dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)
+
+static void dolog(const char *file, int line, const char *func, char *fmt, ...)
+     __attribute__((format(printf,4,5)));
 
 static void dolog(const char *file, int line, const char *func, char *fmt, ...)
 {
@@ -1123,7 +1126,7 @@ static int handle_domain_death(libxl_ctx
         action = d_config->on_watchdog;
         break;
     default:
-        LOG("Unknown shutdown reason code %s. Destroying domain.", 
info->shutdown_reason);
+        LOG("Unknown shutdown reason code %d. Destroying domain.", 
info->shutdown_reason);
         action = ACTION_DESTROY;
     }
 
@@ -1537,7 +1540,7 @@ start:
         }
         rc = libxl_create_logfile(&ctx, name, &fullname);
         if (rc) {
-            LOG("failed to open logfile %s",fullname,strerror(errno));
+            LOG("failed to open logfile %s: %s",fullname,strerror(errno));
             exit(-1);
         }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: correct calls to dolog() (aka LOG), Xen patchbot-unstable <=