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>
This commit is contained in:
Kevin Wolf 2019-06-13 17:34:04 +02:00 committed by Markus Armbruster
parent 920824165c
commit fbfc29e3bf
10 changed files with 27 additions and 36 deletions

View file

@ -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,