diff options
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/hmp.c | 4 | ||||
-rw-r--r-- | monitor/monitor-internal.h | 3 | ||||
-rw-r--r-- | monitor/monitor.c | 9 | ||||
-rw-r--r-- | monitor/qmp.c | 7 |
4 files changed, 4 insertions, 19 deletions
diff --git a/monitor/hmp.c b/monitor/hmp.c index 379e366984..5223661e82 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1395,14 +1395,14 @@ static void monitor_readline_flush(void *opaque) monitor_flush(&mon->common); } -void monitor_init_hmp(Chardev *chr, int flags) +void monitor_init_hmp(Chardev *chr, bool use_readline) { MonitorHMP *mon = g_new0(MonitorHMP, 1); monitor_data_init(&mon->common, false, false, false); qemu_chr_fe_init(&mon->common.chr, chr, &error_abort); - mon->use_readline = flags & MONITOR_USE_READLINE; + mon->use_readline = use_readline; if (mon->use_readline) { mon->rs = readline_init(monitor_readline_printf, monitor_readline_flush, diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h index 03ea0239ef..7760b22ba3 100644 --- a/monitor/monitor-internal.h +++ b/monitor/monitor-internal.h @@ -163,9 +163,6 @@ extern int mon_refcount; extern HMPCommand hmp_cmds[]; -void monitor_init_qmp(Chardev *chr, int flags); -void monitor_init_hmp(Chardev *chr, int flags); - int monitor_puts(Monitor *mon, const char *str); void monitor_data_init(Monitor *mon, bool is_qmp, bool skip_flush, bool use_io_thread); diff --git a/monitor/monitor.c b/monitor/monitor.c index 3f4808240a..3ef28171c0 100644 --- a/monitor/monitor.c +++ b/monitor/monitor.c @@ -551,15 +551,6 @@ void monitor_data_destroy(Monitor *mon) qemu_mutex_destroy(&mon->mon_lock); } -void monitor_init(Chardev *chr, int flags) -{ - if (flags & MONITOR_USE_CONTROL) { - monitor_init_qmp(chr, flags); - } else { - monitor_init_hmp(chr, flags); - } -} - void monitor_cleanup(void) { /* 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(); |