]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
big cleanup of the debug configuration option
authorDaniel Veillard <veillard@redhat.com>
Fri, 26 Jun 2009 15:08:04 +0000 (15:08 +0000)
committerDaniel Veillard <veillard@redhat.com>
Fri, 26 Jun 2009 15:08:04 +0000 (15:08 +0000)
* src/Makefile.am src/libvirt.c src/libvirt_private.syms src/logging.c
  src/logging.h src/util.c src/libvirt_debug.syms: big cleanup of
  the debug configuration option and code by Amy Griffis
daniel

ChangeLog
src/Makefile.am
src/libvirt.c
src/libvirt_debug.syms [deleted file]
src/libvirt_private.syms
src/logging.c
src/logging.h
src/util.c

index 1cb57ec77341a04908dd994533a48e846e480d1a..b45bb1335880e27e7e69b2a858b379e41c695612 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 26 17:06:18 CEST 2009 Daniel Veillard <veillard@redhat.com>
+
+       * src/Makefile.am src/libvirt.c src/libvirt_private.syms src/logging.c
+         src/logging.h src/util.c src/libvirt_debug.syms: big cleanup of
+         the debug configuration option and code by Amy Griffis
+
 Fri Jun 26 16:07:54 CEST 2009 Daniel Veillard <veillard@redhat.com>
 
        * src/node_device.c src/node_device_hal.h src/node_device_hal_linux.c:
index 83d083340ddc0b613ed07bddbb3da4259e8ff6ac..19ea781140953856a165f2a4cca12c45fa8588ac 100644 (file)
@@ -501,10 +501,6 @@ EXTRA_DIST +=                                                      \
 # symbols aren't present at all.
 #
 
-if ENABLE_DEBUG
-USED_SYM_FILES += libvirt_debug.syms
-endif
-
 if WITH_DRIVER_MODULES
 USED_SYM_FILES += libvirt_driver_modules.syms
 endif
@@ -520,7 +516,6 @@ endif
 EXTRA_DIST += \
   libvirt_public.syms          \
   libvirt_private.syms         \
-  libvirt_debug.syms           \
   libvirt_driver_modules.syms  \
   libvirt_bridge.syms          \
   libvirt_linux.syms
index ecf56f9eb2978670cff95c432d3dcab38fb8315d..17321a2e097e91a61f830dbef3bb763101ad87de 100644 (file)
@@ -256,9 +256,7 @@ winsock_init (void)
 int
 virInitialize(void)
 {
-#ifdef ENABLE_DEBUG
     char *debugEnv;
-#endif
     if (initialized)
         return(0);
 
@@ -269,7 +267,6 @@ virInitialize(void)
         virRandomInitialize(time(NULL) ^ getpid()))
         return -1;
 
-#ifdef ENABLE_DEBUG
     debugEnv = getenv("LIBVIRT_DEBUG");
     if (debugEnv && *debugEnv && *debugEnv != '0') {
         if (STREQ(debugEnv, "2") || STREQ(debugEnv, "info"))
@@ -287,7 +284,6 @@ virInitialize(void)
     debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
     if (debugEnv)
         virLogParseOutputs(debugEnv);
-#endif
 
     DEBUG0("register drivers");
 
@@ -1055,13 +1051,11 @@ do_open (const char *name,
     /* Secondary driver for storage. Optional */
     for (i = 0; i < virStorageDriverTabCount; i++) {
         res = virStorageDriverTab[i]->open (ret, auth, flags);
-#ifdef ENABLE_DEBUG
         DEBUG("storage driver %d %s returned %s",
               i, virStorageDriverTab[i]->name,
               res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
               (res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
                (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
-#endif
         if (res == VIR_DRV_OPEN_ERROR) {
             if (0 && STREQ(virStorageDriverTab[i]->name, "remote")) {
                 virLibConnWarning (NULL, VIR_WAR_NO_STORAGE,
diff --git a/src/libvirt_debug.syms b/src/libvirt_debug.syms
deleted file mode 100644 (file)
index 1742a0b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# These symbols are dependent upon --enable-debug.
-#
-
-
-# libvirt_internal.h
-debugFlag;
-
-
-# logging.h
-virLogMessage;
-virLogSetDefaultPriority;
-virLogDefineFilter;
-virLogDefineOutput;
-virLogParseFilters;
-virLogParseOutputs;
-virLogStartup;
-virLogShutdown;
-virLogReset;
index 309d7f99116527b6577ee328356fbfefa3f96ee6..3958d9b4f3efd247f4d813355eaa6f5db899be74 100644 (file)
@@ -192,6 +192,18 @@ virRegisterStorageDriver;
 virRegisterDeviceMonitor;
 
 
+# logging.h
+virLogMessage;
+virLogSetDefaultPriority;
+virLogDefineFilter;
+virLogDefineOutput;
+virLogParseFilters;
+virLogParseOutputs;
+virLogStartup;
+virLogShutdown;
+virLogReset;
+
+
 # memory.h
 virAlloc;
 virAllocN;
index 83e07ccf61b35f9f3f19bdb9ec9df681f5b07e69..fd1d5d4d41310e16debd6740c3020128769fb179 100644 (file)
@@ -39,9 +39,6 @@
 #include "util.h"
 #include "threads.h"
 
-#ifdef ENABLE_DEBUG
-int debugFlag = 0;
-
 /*
  * Macro used to format the message as a string in virLogMessage
  * and borrowed from libxml2 (also used in virRaiseError)
@@ -793,5 +790,4 @@ int virLogParseFilters(const char *filters) {
     }
     return(ret);
 }
-#endif /* ENABLE_DEBUG */
 
index 7ea8935f8e9f5393bbdb6861905e14d70269d29f..d99bb31b707d322fea7eb600fe1371332a8c9ff2 100644 (file)
 #ifdef ENABLE_DEBUG
 #define VIR_DEBUG_INT(category, f, l, fmt,...)                             \
     virLogMessage(category, VIR_LOG_DEBUG, f, l, 0, fmt, __VA_ARGS__)
+#else
+#define VIR_DEBUG_INT(category, f, l, fmt,...) \
+    do { } while (0)
+#endif /* !ENABLE_DEBUG */
+
 #define VIR_INFO_INT(category, f, l, fmt,...)                              \
     virLogMessage(category, VIR_LOG_INFO, f, l, 0, fmt, __VA_ARGS__)
 #define VIR_WARN_INT(category, f, l, fmt,...)                              \
     virLogMessage(category, VIR_LOG_WARN, f, l, 0, fmt, __VA_ARGS__)
 #define VIR_ERROR_INT(category, f, l, fmt,...)                             \
     virLogMessage(category, VIR_LOG_ERROR, f, l, 0, fmt, __VA_ARGS__)
-#else
-#define VIR_DEBUG_INT(category, f, l, fmt,...) \
-    do { } while (0)
-#define VIR_INFO_INT(category, f, l, fmt,...) \
-    do { } while (0)
-#define VIR_WARN_INT(category, f, l, fmt,...) \
-    do { } while (0)
-#define VIR_ERROR_INT(category, f, l, fmt,...) \
-    do { } while (0)
-#endif /* !ENABLE_DEBUG */
 
 #define VIR_DEBUG(fmt,...)                                                  \
         VIR_DEBUG_INT("file." __FILE__, __func__, __LINE__, fmt, __VA_ARGS__)
@@ -108,8 +103,6 @@ typedef int (*virLogOutputFunc) (const char *category, int priority,
  */
 typedef void (*virLogCloseFunc) (void *data);
 
-#ifdef ENABLE_DEBUG
-
 extern int virLogSetDefaultPriority(int priority);
 extern int virLogDefineFilter(const char *match, int priority, int flags);
 extern int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c,
@@ -128,18 +121,4 @@ extern void virLogMessage(const char *category, int priority,
                           const char *funcname, long long linenr, int flags,
                           const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 6, 7);
 
-#else /* ENABLE_DEBUG */
-
-#define virLogSetDefaultPriority(p)
-#define virLogDefineFilter(m, p, f)
-#define virLogDefineOutput(func, c, d, p, f)
-#define virLogStartup()
-#define virLogReset()
-#define virLogShutdown()
-#define virLogParseFilters(f)
-#define virLogParseOutputs(o)
-#define virLogMessage(c, p, func, l, f, fmt, __VA_ARGS__)
-
-#endif /* ENABLE_DEBUG */
-
 #endif
index 8b746f5ae720bb3338d42e3eaf86372c22d30d14..408e17ac3eec77455e08c08b39f1a3ceea5bf985 100644 (file)
@@ -349,10 +349,6 @@ __virExec(virConnectPtr conn,
         } else {
             childout = *outfd;
         }
-#ifndef ENABLE_DEBUG
-    } else {
-        childout = null;
-#endif
     }
 
     if (errfd != NULL) {
@@ -380,10 +376,6 @@ __virExec(virConnectPtr conn,
         } else {
             childerr = *errfd;
         }
-#ifndef ENABLE_DEBUG
-    } else {
-        childerr = null;
-#endif
     }
 
     if ((pid = fork()) < 0) {