From nobody Tue Nov 4 18:44:23 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530694030214220.83466555511416; Wed, 4 Jul 2018 01:47:10 -0700 (PDT) Received: from localhost ([::1]:44690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fadRL-00023G-GS for importer@patchew.org; Wed, 04 Jul 2018 04:47:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fadPY-0001AG-U3 for qemu-devel@nongnu.org; Wed, 04 Jul 2018 04:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fadPY-0005jv-3o for qemu-devel@nongnu.org; Wed, 04 Jul 2018 04:45:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34366 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fadPX-0005jn-Nb for qemu-devel@nongnu.org; Wed, 04 Jul 2018 04:45:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D885401DEA8 for ; Wed, 4 Jul 2018 08:45:15 +0000 (UTC) Received: from xz-mi.redhat.com (ovpn-12-35.pek2.redhat.com [10.72.12.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B1AC2026D76; Wed, 4 Jul 2018 08:45:11 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 4 Jul 2018 16:44:59 +0800 Message-Id: <20180704084507.14560-2-peterx@redhat.com> In-Reply-To: <20180704084507.14560-1-peterx@redhat.com> References: <20180704084507.14560-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 04 Jul 2018 08:45:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 04 Jul 2018 08:45:15 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'peterx@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/9] monitor: simplify monitor_qmp_setup_handlers_bh 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: "Dr . David Alan Gilbert" , peterx@redhat.com, Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When we reach monitor_qmp_setup_handlers_bh() we must be using the IOThread then, so no need to check against it any more. Instead, we assert. Signed-off-by: Peter Xu Reviewed-by: Markus Armbruster --- monitor.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/monitor.c b/monitor.c index 14af7b7ea6..0e3ac52d87 100644 --- a/monitor.c +++ b/monitor.c @@ -4583,15 +4583,10 @@ static void monitor_qmp_setup_handlers_bh(void *opa= que) Monitor *mon =3D opaque; GMainContext *context; =20 - if (mon->use_io_thread) { - /* Use @mon_iothread context */ - context =3D monitor_get_io_context(); - assert(context); - } else { - /* Use default main loop context */ - context =3D NULL; - } - + assert(mon->use_io_thread); + /* Use @mon_iothread context */ + context =3D monitor_get_io_context(); + assert(context); qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read, monitor_qmp_read, monitor_qmp_event, NULL, mon, context, true); monitor_list_append(mon); --=20 2.17.1