qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 12/14] target-i386: Convert conditional compilation


From: Marc Marí
Subject: [Qemu-devel] [PATCH 12/14] target-i386: Convert conditional compilation of debug printfs to regular ifs
Date: Mon, 28 Apr 2014 10:26:13 +0200

From: Marc Marí <address@hidden>

Modify debug macros as explained in 
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html

Signed-off-by: Marc Marí <address@hidden>
---
 target-i386/kvm.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 4389959..9d511ff 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -34,16 +34,19 @@
 #include <asm/hyperv.h>
 #include "hw/pci/pci.h"
 
-//#define DEBUG_KVM
+//#define DEBUG_KVM 1
 
-#ifdef DEBUG_KVM
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
+#ifndef DEBUG_KVM
+#define DEBUG_KVM 0
 #endif
 
+#define DPRINTF(fmt, ...) \
+    do { \
+        if(DEBUG_KVM) { \
+            fprintf(stderr, fmt, ## __VA_ARGS__); \
+        } \
+    } while (0)
+
 #define MSR_KVM_WALL_CLOCK  0x11
 #define MSR_KVM_SYSTEM_TIME 0x12
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]