monitor: Split Monitor.flags into separate bools

Monitor.flags contains three different flags: One to distinguish HMP
from QMP; one specific to HMP (MONITOR_USE_READLINE) that is ignored
with QMP; and another one specific to QMP (MONITOR_USE_PRETTY) that is
ignored with HMP.

Split the flags field into three bools and move them to the right
subclass. Flags are still in use for the monitor_init() interface.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190613153405.24769-14-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:03 +02:00 committed by Markus Armbruster
parent 1d95db745b
commit 920824165c
5 changed files with 22 additions and 15 deletions

View file

@ -1398,12 +1398,12 @@ static void monitor_readline_flush(void *opaque)
void monitor_init_hmp(Chardev *chr, int flags)
{
MonitorHMP *mon = g_new0(MonitorHMP, 1);
bool use_readline = flags & MONITOR_USE_READLINE;
monitor_data_init(&mon->common, flags, false, false);
monitor_data_init(&mon->common, false, false, false);
qemu_chr_fe_init(&mon->common.chr, chr, &error_abort);
if (use_readline) {
mon->use_readline = flags & MONITOR_USE_READLINE;
if (mon->use_readline) {
mon->rs = readline_init(monitor_readline_printf,
monitor_readline_flush,
mon,