The patch cleans up some uses of qemudDebug, moving
them over to use the DEBUG macros.

There are still lots of uses of qemudDebug in qemud/*,
but I don't know if they can/should be moved over to
use DEBUG.

Thanks,
Cole
commit 99c6268b660f00eb906d936248df83348befa5ab
Author: Cole Robinson <[EMAIL PROTECTED]>
Date:   Thu Oct 2 14:09:53 2008 -0400

    Replace uses of qemudDebug with DEBUG

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 23ef050..314c14a 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -470,8 +470,8 @@ int qemudExtractVersionInfo(const char *qemu,
 
     ret = 0;
 
-    qemudDebug("Version %d %d %d  Cooked version: %d, with flags ? %d",
-               major, minor, micro, version, flags);
+    DEBUG("Version %d %d %d  Cooked version: %d, with flags ? %d",
+          major, minor, micro, version, flags);
 
 cleanup2:
     VIR_FREE(help);
diff --git a/src/qemu_conf.h b/src/qemu_conf.h
index 88dfade..0099dff 100644
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -33,8 +33,6 @@
 #include "network_conf.h"
 #include "domain_conf.h"
 
-#define qemudDebug(fmt, ...) do {} while(0)
-
 #define QEMUD_CPUMASK_LEN CPU_SETSIZE
 
 /* Internal flags to keep track of qemu command line capabilities */
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 9d8f75a..7dce0f0 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -72,10 +72,6 @@
 static int qemudShutdown(void);
 #endif
 
-/* qemudDebug statements should be changed to use this macro instead. */
-#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
-#define DEBUG0(msg) VIR_DEBUG(__FILE__, "%s", msg)
-
 #define qemudLog(level, msg...) fprintf(stderr, msg)
 
 static int qemudSetCloseExec(int fd) {
@@ -1937,7 +1933,7 @@ static int qemudGetProcessInfo(unsigned long long *cpuTime, int pid) {
     }
 
     if (fscanf(pidinfo, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu", &usertime, &systime) != 2) {
-        qemudDebug("not enough arg");
+        DEBUG0("not enough args");
         return -1;
     }
 
@@ -1948,7 +1944,7 @@ static int qemudGetProcessInfo(unsigned long long *cpuTime, int pid) {
      */
     *cpuTime = 1000ull * 1000ull * 1000ull * (usertime + systime) / (unsigned long long)sysconf(_SC_CLK_TCK);
 
-    qemudDebug("Got %llu %llu %llu", usertime, systime, *cpuTime);
+    DEBUG("Got %llu %llu %llu", usertime, systime, *cpuTime);
 
     fclose(pidinfo);
 
@@ -2128,7 +2124,7 @@ static int qemudDomainSuspend(virDomainPtr dom) {
         return -1;
     }
     vm->state = VIR_DOMAIN_PAUSED;
-    qemudDebug("Reply %s", info);
+    DEBUG("Reply %s", info);
     VIR_FREE(info);
     return 0;
 }
@@ -2156,7 +2152,7 @@ static int qemudDomainResume(virDomainPtr dom) {
         return -1;
     }
     vm->state = VIR_DOMAIN_RUNNING;
-    qemudDebug("Reply %s", info);
+    DEBUG("Reply %s", info);
     VIR_FREE(info);
     return 0;
 }
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to