summary refs log tree commit diff stats
path: root/monitor/qmp.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-06-13 17:34:04 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-06-18 08:14:17 +0200
commitfbfc29e3bf145581e84c12ffc432ab56ce1dea0d (patch)
tree2922c5fadb07f55fb45b816bdd1806c4cfcaed46 /monitor/qmp.c
parent920824165c49bfbd1e0e9e07fd92e0bbbf32aea3 (diff)
downloadfocaccia-qemu-fbfc29e3bf145581e84c12ffc432ab56ce1dea0d.tar.gz
focaccia-qemu-fbfc29e3bf145581e84c12ffc432ab56ce1dea0d.zip
monitor: Replace monitor_init() with monitor_init_{hmp, qmp}()
Most callers know which monitor type they want to have. Instead of
calling monitor_init() with flags that can describe both types of
monitors, make monitor_init_{hmp,qmp}() public interfaces that take
specific bools instead of flags and call these functions directly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190613153405.24769-15-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'monitor/qmp.c')
-rw-r--r--monitor/qmp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/monitor/qmp.c b/monitor/qmp.c
index 940649f688..e1b196217d 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -364,18 +364,15 @@ static void monitor_qmp_setup_handlers_bh(void *opaque)
     monitor_list_append(&mon->common);
 }
 
-void monitor_init_qmp(Chardev *chr, int flags)
+void monitor_init_qmp(Chardev *chr, bool pretty)
 {
     MonitorQMP *mon = g_new0(MonitorQMP, 1);
 
-    /* Only HMP supports readline */
-    assert(!(flags & MONITOR_USE_READLINE));
-
     /* Note: we run QMP monitor in I/O thread when @chr supports that */
     monitor_data_init(&mon->common, true, false,
                       qemu_chr_has_feature(chr, QEMU_CHAR_FEATURE_GCONTEXT));
 
-    mon->pretty = flags & MONITOR_USE_PRETTY;
+    mon->pretty = pretty;
 
     qemu_mutex_init(&mon->qmp_queue_lock);
     mon->qmp_requests = g_queue_new();