From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeDpz-00034A-3Z for qemu-devel@nongnu.org; Wed, 24 Jan 2018 00:43:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeDpw-00019V-0e for qemu-devel@nongnu.org; Wed, 24 Jan 2018 00:43:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57908) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eeDpv-00018v-Rf for qemu-devel@nongnu.org; Wed, 24 Jan 2018 00:43:03 -0500 From: Peter Xu Date: Wed, 24 Jan 2018 13:39:54 +0800 Message-Id: <20180124053957.29145-21-peterx@redhat.com> In-Reply-To: <20180124053957.29145-1-peterx@redhat.com> References: <20180124053957.29145-1-peterx@redhat.com> Subject: [Qemu-devel] [PATCH v7 20/23] monitor: enable IO thread for (qmp & !mux) typed 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" Start to use dedicate IO thread for QMP monitors that are not using MUXed chardev. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Peter Xu --- monitor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index eac92c9b86..5b7da2b574 100644 --- a/monitor.c +++ b/monitor.c @@ -36,6 +36,7 @@ #include "net/slirp.h" #include "chardev/char-fe.h" #include "chardev/char-io.h" +#include "chardev/char-mux.h" #include "ui/qemu-spice.h" #include "sysemu/numa.h" #include "monitor/monitor.h" @@ -4579,8 +4580,10 @@ static void monitor_qmp_setup_handlers(void *data) void monitor_init(Chardev *chr, int flags) { Monitor *mon = g_malloc(sizeof(*mon)); + /* Enable IOThread for QMPs that are not using MUX chardev backends. */ + bool use_io_thr = (!CHARDEV_IS_MUX(chr)) && (flags & MONITOR_USE_CONTROL); - monitor_data_init(mon, false, false); + monitor_data_init(mon, false, use_io_thr); qemu_chr_fe_init(&mon->chr, chr, &error_abort); mon->flags = flags; -- 2.14.3