diff options
author | Kevin Wolf <kwolf@redhat.com> | 2019-06-13 17:34:03 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-06-18 08:14:17 +0200 |
commit | 920824165c49bfbd1e0e9e07fd92e0bbbf32aea3 (patch) | |
tree | e338c3af03ec3f86d017b581cf5d7f86fc8b2e65 /monitor/hmp.c | |
parent | 1d95db745b78439e9eec0782eca9cc0d679d6224 (diff) |
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>
Diffstat (limited to 'monitor/hmp.c')
-rw-r--r-- | monitor/hmp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/monitor/hmp.c b/monitor/hmp.c index cbbee6477a..379e366984 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -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, |