aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-11 17:05:43 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 17:01:08 +0100
commit6620d3ce9ee44c01c7d715322be7879ad3d98c7a (patch)
tree0085d27f5b1fdf3bde7e7eb12eb67721637d39ed /monitor.c
parent036f7166c73a9e0cc1b2f10c03763e61894a1033 (diff)
monitor: New monitor_cur_is_qmp()
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 4b6184b765..d8a31242b6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -194,6 +194,12 @@ static inline int monitor_ctrl_mode(const Monitor *mon)
return (mon->flags & MONITOR_USE_CONTROL);
}
+/* Return non-zero iff we have a current monitor, and it is in QMP mode. */
+int monitor_cur_is_qmp(void)
+{
+ return cur_mon && monitor_ctrl_mode(cur_mon);
+}
+
static void monitor_read_command(Monitor *mon, int show_prompt)
{
if (!mon->rs)