From patchwork Wed Dec 12 10:11:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 10725951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D20391E for ; Wed, 12 Dec 2018 10:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF242B048 for ; Wed, 12 Dec 2018 10:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02B1F2B060; Wed, 12 Dec 2018 10:13:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5C072B048 for ; Wed, 12 Dec 2018 10:13:20 +0000 (UTC) Received: from localhost ([::1]:43673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1W3-00028o-Ij for patchwork-qemu-devel@patchwork.kernel.org; Wed, 12 Dec 2018 05:13:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1Ue-0000u2-Na for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:11:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX1Uc-0003NA-J0 for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:11:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33200) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gX1Uc-0003Lz-Aw for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:11:50 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB0C430024EF for ; Wed, 12 Dec 2018 10:11:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-56.ams2.redhat.com [10.36.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 900501001925; Wed, 12 Dec 2018 10:11:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 28A6E11384AA; Wed, 12 Dec 2018 11:11:45 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 12 Dec 2018 11:11:38 +0100 Message-Id: <20181212101145.3496-5-armbru@redhat.com> In-Reply-To: <20181212101145.3496-1-armbru@redhat.com> References: <20181212101145.3496-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 12 Dec 2018 10:11:49 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/11] monitor: check if chardev can switch gcontext for OOB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau Not all backends are able to switch gcontext. Those backends cannot drive a OOB monitor (the monitor would then be blocking on main thread). For example, ringbuf, spice, or more esoteric input chardevs like braille or MUX. We already forbid MUX because not all frontends are ready to run outside main loop. Replace that by a context-switching feature check. Signed-off-by: Marc-André Lureau Message-Id: <20181205203737.9011-5-marcandre.lureau@redhat.com> [Error condition simplified, commit message adjusted accordingly] Signed-off-by: Markus Armbruster --- monitor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 79afe99079..a1329d8a86 100644 --- a/monitor.c +++ b/monitor.c @@ -4562,9 +4562,10 @@ void monitor_init(Chardev *chr, int flags) bool use_oob = flags & MONITOR_USE_OOB; if (use_oob) { - if (CHARDEV_IS_MUX(chr)) { + if (!qemu_chr_has_feature(chr, QEMU_CHAR_FEATURE_GCONTEXT)) { error_report("Monitor out-of-band is not supported with " - "MUX typed chardev backend"); + "%s typed chardev backend", + object_get_typename(OBJECT(chr))); exit(1); } if (use_readline) {