[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 05/27] monitor: move skip_flush into monitor_data_i
From: |
Peter Xu |
Subject: |
[Qemu-devel] [RFC v3 05/27] monitor: move skip_flush into monitor_data_init |
Date: |
Mon, 6 Nov 2017 17:46:21 +0800 |
It's part of the data init. Collect it.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
---
monitor.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/monitor.c b/monitor.c
index e36fb5308d..3940737c1c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -568,13 +568,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)
@@ -595,8 +596,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;
@@ -4089,7 +4089,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;
--
2.13.5
- Re: [Qemu-devel] [RFC v3 01/27] char-io: fix possible race on IOWatchPoll, (continued)
[Qemu-devel] [RFC v3 02/27] qobject: introduce qstring_get_try_str(), Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 03/27] qobject: introduce qobject_get_try_str(), Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 04/27] qobject: let object_property_get_str() use new API, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 05/27] monitor: move skip_flush into monitor_data_init,
Peter Xu <=
[Qemu-devel] [RFC v3 06/27] qjson: add "opaque" field to JSONMessageParser, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 07/27] monitor: move the cur_mon hack deeper for QMP, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 08/27] monitor: unify global init, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 09/27] monitor: let mon_list be tail queue, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 10/27] monitor: create monitor dedicate iothread, Peter Xu, 2017/11/06