From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRDXy-0000Du-WD for qemu-devel@nongnu.org; Tue, 19 Dec 2017 03:46:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRDXy-00007t-79 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 03:46:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRDXy-00007H-0a for qemu-devel@nongnu.org; Tue, 19 Dec 2017 03:46:46 -0500 From: Peter Xu Date: Tue, 19 Dec 2017 16:45:35 +0800 Message-Id: <20171219084557.9801-6-peterx@redhat.com> In-Reply-To: <20171219084557.9801-1-peterx@redhat.com> References: <20171219084557.9801-1-peterx@redhat.com> Subject: [Qemu-devel] [RFC v6 05/27] monitor: move skip_flush into monitor_data_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , "Daniel P . Berrange" , Paolo Bonzini , Fam Zheng , Juan Quintela , mdroth@linux.vnet.ibm.com, peterx@redhat.com, Eric Blake , Laurent Vivier , Markus Armbruster , marcandre.lureau@redhat.com, "Dr . David Alan Gilbert" It's part of the data init. Collect it. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- monitor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index d682eee2d8..0030ded8f1 100644 --- a/monitor.c +++ b/monitor.c @@ -567,13 +567,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) @@ -594,8 +595,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; @@ -4088,7 +4088,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