xenpaging: print DPRINTF ouput if XENPAGING_DEBUG is in environment
authorOlaf Hering <olaf@aepfle.de>
Tue, 14 Dec 2010 18:48:44 +0000 (18:48 +0000)
committerOlaf Hering <olaf@aepfle.de>
Tue, 14 Dec 2010 18:48:44 +0000 (18:48 +0000)
No DPRINTF output is logged because the default loglevel is to low in
libxc. Recognize the XENPAGING_DEBUG environment variable to change the
default loglevel at runtime.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenpaging/xenpaging.c

index 0e82121e29a5fd503854f164e32298277d54a06e..76f0579616aef3510a462fca4397cce0f20b12b4 100644 (file)
 #include "policy.h"
 #include "xenpaging.h"
 
-
-#if 0
-#undef DPRINTF
-#define DPRINTF(...) ((void)0)
-#endif
-
 static char filename[80];
 static int interrupted;
 static void close_handler(int sig)
@@ -83,9 +77,12 @@ xenpaging_t *xenpaging_init(xc_interface **xch_r, domid_t domain_id)
 {
     xenpaging_t *paging;
     xc_interface *xch;
+    xentoollog_logger *dbg = NULL;
     int rc;
 
-    xch = xc_interface_open(NULL, NULL, 0);
+    if ( getenv("XENPAGING_DEBUG") )
+        dbg = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, XTL_DEBUG, 0);
+    xch = xc_interface_open(dbg, NULL, 0);
     if ( !xch )
         goto err_iface;