aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-03-09 16:59:48 +0800
committerEric Blake <eblake@redhat.com>2018-03-19 14:58:36 -0500
commit88a95d1090f9d9d60016ded3c129bf9952f8fa29 (patch)
tree051a31ca50e0dca41f61b9457e90d8977c62669d /monitor.c
parentaafb21a0b9cea5fa0fe52e68111bb6bd13837a02 (diff)
monitor: move skip_flush into monitor_data_init
It's part of the data init. Collect it. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-6-peterx@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor.c b/monitor.c
index aeabb859f2..35d35bcd00 100644
--- a/monitor.c
+++ b/monitor.c
@@ -570,13 +570,14 @@ static void monitor_qapi_event_init(void)
static void handle_hmp_command(Monitor *mon, const char *cmdline);
-static void monitor_data_init(Monitor *mon)
+static void monitor_data_init(Monitor *mon, bool skip_flush)
{
memset(mon, 0, sizeof(Monitor));
qemu_mutex_init(&mon->out_lock);
mon->outbuf = qstring_new();
/* Use *mon_cmds by default. */
mon->cmd_table = mon_cmds;
+ mon->skip_flush = skip_flush;
}
static void monitor_data_destroy(Monitor *mon)
@@ -597,8 +598,7 @@ char *qmp_human_monitor_command(const char *command_line, bool has_cpu_index,
char *output = NULL;
Monitor *old_mon, hmp;
- monitor_data_init(&hmp);
- hmp.skip_flush = true;
+ monitor_data_init(&hmp, true);
old_mon = cur_mon;
cur_mon = &hmp;
@@ -4042,7 +4042,7 @@ void monitor_init(Chardev *chr, int flags)
}
mon = g_malloc(sizeof(*mon));
- monitor_data_init(mon);
+ monitor_data_init(mon, false);
qemu_chr_fe_init(&mon->chr, chr, &error_abort);
mon->flags = flags;