[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 05/23] monitor: move skip_flush into monitor_data
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v8 05/23] monitor: move skip_flush into monitor_data_init |
Date: |
Fri, 9 Mar 2018 16:59:48 +0800 |
It's part of the data init. Collect it.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <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 a4417f26cd..48645e0e91 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;
@@ -4039,7 +4039,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.14.3
- [Qemu-devel] [PATCH v8 00/23] QMP: out-of-band (OOB) execution support, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 02/23] qobject: introduce qstring_get_try_str(), Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 01/23] docs: update QMP documents for OOB commands, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 03/23] qobject: introduce qobject_get_try_str(), Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 04/23] qobject: let object_property_get_str() use new API, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 05/23] monitor: move skip_flush into monitor_data_init,
Peter Xu <=
- [Qemu-devel] [PATCH v8 06/23] monitor: move the cur_mon hack deeper for QMP, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 08/23] monitor: let mon_list be tail queue, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 07/23] monitor: unify global init, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 09/23] monitor: allow using IO thread for parsing, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 10/23] qmp: introduce QMPCapability, Peter Xu, 2018/03/09
- [Qemu-devel] [PATCH v8 11/23] monitor: introduce monitor_qmp_respond(), Peter Xu, 2018/03/09