summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-10 23:50:03 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-19 15:18:18 -0600
commiteea8c22c2b2cddfcaef5a63b51e60fc10a5cf4a3 (patch)
tree7cc4bef7942a0e53afd96ac6d8d2291e1b845a4e /monitor.c
parentd51b3526f5481ecdaf1f3a98438a9e0c5ac162d1 (diff)
downloadqemu-eea8c22c2b2cddfcaef5a63b51e60fc10a5cf4a3.tar.gz
qemu-eea8c22c2b2cddfcaef5a63b51e60fc10a5cf4a3.tar.bz2
qemu-eea8c22c2b2cddfcaef5a63b51e60fc10a5cf4a3.zip
Monitor: Debugging support
Add configure options (--enable-debug-mon and --disable-debug-mon) plus the MON_DEBUG() macro. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 6eb0e2cfa9..2a14e81614 100644
--- a/monitor.c
+++ b/monitor.c
@@ -143,6 +143,14 @@ struct Monitor {
QLIST_ENTRY(Monitor) entry;
};
+#ifdef CONFIG_DEBUG_MONITOR
+#define MON_DEBUG(fmt, ...) do { \
+ fprintf(stderr, "Monitor: "); \
+ fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
+#else /* !CONFIG_DEBUG_MONITOR */
+#define MON_DEBUG(fmt, ...) do { } while (0)
+#endif /* CONFIG_DEBUG_MONITOR */
+
static QLIST_HEAD(mon_list, Monitor) mon_list;
static const mon_cmd_t mon_cmds[];