From nobody Wed Feb 11 05:35:49 2026 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506036952859508.35572444291506; Thu, 21 Sep 2017 16:35:52 -0700 (PDT) Received: from localhost ([::1]:55945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvB0T-0003zM-3V for importer@patchew.org; Thu, 21 Sep 2017 19:35:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvAig-00058w-8B for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvAie-0004fp-VC for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:22 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:38021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvAie-0004ef-O3 for qemu-devel@nongnu.org; Thu, 21 Sep 2017 19:17:20 -0400 Received: by mail-wr0-x241.google.com with SMTP id p37so3842333wrb.5 for ; Thu, 21 Sep 2017 16:17:20 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-246-117.clienti.tiscali.it. [78.12.246.117]) by smtp.gmail.com with ESMTPSA id u186sm2596278wmd.19.2017.09.21.16.17.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 16:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ScRm3FFTwe//Y1Cg07gsPOzsNvZeU2tJly8rh9X0IU0=; b=n7SbDbsCXU/gFdJzBmFUcv0w2vBuC6rh4q6KqK6pSx3TUOZduFrYjwNbBOLW4T6M5a KeL0G/1WKCPNpdoGSkLAbmn2gwRuOymFBKxqitF3UGKXkHunl4BwS0TOPobOdjEei1jL JvSaGYm/yf4uuBcCpoJ5dpRsrY5e6r0jZWG6DMn0F2BCGyiFeASZvtNT+BmvSHy2dAHo gzgOssfDj1X3RvF8cc/uZGaSzXH4stzUI1nILK+TwKhVjDjXEyqB53V3FLEhfBG/EaL5 5vSIhSZSvvb/1KGvdpBJuc0n3h5/M220u4YTZmbtyUj35pQwaMyAt5IozAAk0oEmh581 DKCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ScRm3FFTwe//Y1Cg07gsPOzsNvZeU2tJly8rh9X0IU0=; b=X3BQH9Xc1ivrja6TQhSoDvZGEN/3t+egu5TbMyufs2iioeQK+jc/b9SuTtMUSFi9Od nQjYFUkPnUN+PtVy6RNBn1tLFesRqIK0sa2JhHPBuZfSxbyvLOK/XCyTbB8NHVZSjLNA 7nogofZP6vFA7Tf4S54RjK1u2oE+DfCCAxaUktDpT8Nlq2cli2oMsLRQVleSEjD0SDms lAw+JJthqYd22yPsb6gjqWt1H8x6ruNOSUup1gysiCYQxeZLCzfMD2rpoutedfOl3Mc/ /7qErH+SSGRMNK8JQ8Ud2i9Z8JgZRj0E5tlgY0IpLTsvDkU62LSJqfHrNn8TYAGinwTo mk8g== X-Gm-Message-State: AHPjjUidA5bD01S4eO0uEXCgETvhOKSfpyo7b3aAkdqrcXQMpUxxppvL Vi4puK3CIJWfVkcr6My5814kAmvw X-Google-Smtp-Source: AOwi7QAWvYIaM8hV22Jix642CgFz8HwPoDBxRYVArD7zE5/uePn9ZpfW8WYD+D4uQ1INKY1aZJUxiQ== X-Received: by 10.223.145.163 with SMTP id 32mr3109036wri.279.1506035839565; Thu, 21 Sep 2017 16:17:19 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 22 Sep 2017 01:16:38 +0200 Message-Id: <1506035800-30509-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1506035800-30509-1-git-send-email-pbonzini@redhat.com> References: <1506035800-30509-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 30/32] chardev: add Chardev.gcontext field 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: Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Peter Xu It caches the gcontext that is used to poll the chardev IO. Before this patch, we only passed it in via chr_update_read_handlers(). However that may not be enough if the char backend is disconnected and reconnected afterward. There are chardev codes that still assumed the context be NULL (which is the main context). Will fix that up in following up patches. Signed-off-by: Peter Xu Message-Id: <1505975754-21555-3-git-send-email-peterx@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- chardev/char.c | 1 + include/chardev/char.h | 1 + 2 files changed, 2 insertions(+) diff --git a/chardev/char.c b/chardev/char.c index e090dd5..89eabea 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -185,6 +185,7 @@ void qemu_chr_be_update_read_handlers(Chardev *s, { ChardevClass *cc =3D CHARDEV_GET_CLASS(s); =20 + s->gcontext =3D context; if (cc->chr_update_read_handler) { cc->chr_update_read_handler(s, context); } diff --git a/include/chardev/char.h b/include/chardev/char.h index 2068ea4..84fb773 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -55,6 +55,7 @@ struct Chardev { int logfd; int be_open; GSource *gsource; + GMainContext *gcontext; DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST); }; =20 --=20 1.8.3.1