From nobody Tue Nov 4 11:11:43 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505974704226980.4281893771365; Wed, 20 Sep 2017 23:18:24 -0700 (PDT) Received: from localhost ([::1]:51982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duuoZ-0000JY-2x for importer@patchew.org; Thu, 21 Sep 2017 02:18:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duukV-00060t-0n for qemu-devel@nongnu.org; Thu, 21 Sep 2017 02:14:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duukT-0008D2-UE for qemu-devel@nongnu.org; Thu, 21 Sep 2017 02:14:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37176) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duukT-0008BN-MC for qemu-devel@nongnu.org; Thu, 21 Sep 2017 02:14:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5BA0356D6 for ; Thu, 21 Sep 2017 06:14:08 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-15-224.nay.redhat.com [10.66.15.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45EE35D6A4; Thu, 21 Sep 2017 06:14:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D5BA0356D6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=peterx@redhat.com From: Peter Xu To: qemu-devel@nongnu.org Date: Thu, 21 Sep 2017 14:13:34 +0800 Message-Id: <1505974414-6033-5-git-send-email-peterx@redhat.com> In-Reply-To: <1505974414-6033-1-git-send-email-peterx@redhat.com> References: <1505974414-6033-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 21 Sep 2017 06:14:08 +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] [PATCH 4/4] chardev: remove context in chr_update_read_handler 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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini 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" We had a per-chardev cache for context, then we don't need this parameter to be passed in every time when chr_update_read_handler() called. As long as we are calling chr_update_read_handler() using qemu_chr_be_update_read_handlers() we'll be fine. Signed-off-by: Peter Xu --- chardev/char-fd.c | 3 +-- chardev/char-pty.c | 3 +-- chardev/char-socket.c | 3 +-- chardev/char-udp.c | 3 +-- include/chardev/char.h | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/chardev/char-fd.c b/chardev/char-fd.c index 09fbb07..2c9b2ce 100644 --- a/chardev/char-fd.c +++ b/chardev/char-fd.c @@ -84,8 +84,7 @@ static GSource *fd_chr_add_watch(Chardev *chr, GIOConditi= on cond) return qio_channel_create_watch(s->ioc_out, cond); } =20 -static void fd_chr_update_read_handler(Chardev *chr, - GMainContext *context) +static void fd_chr_update_read_handler(Chardev *chr) { FDChardev *s =3D FD_CHARDEV(chr); =20 diff --git a/chardev/char-pty.c b/chardev/char-pty.c index d239c04..761ae6d 100644 --- a/chardev/char-pty.c +++ b/chardev/char-pty.c @@ -112,8 +112,7 @@ static void pty_chr_update_read_handler_locked(Chardev = *chr) } } =20 -static void pty_chr_update_read_handler(Chardev *chr, - GMainContext *context) +static void pty_chr_update_read_handler(Chardev *chr) { qemu_mutex_lock(&chr->chr_write_lock); pty_chr_update_read_handler_locked(chr); diff --git a/chardev/char-socket.c b/chardev/char-socket.c index ee71cbe..e65148f 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -521,8 +521,7 @@ static void tcp_chr_connect(void *opaque) qemu_chr_be_event(chr, CHR_EVENT_OPENED); } =20 -static void tcp_chr_update_read_handler(Chardev *chr, - GMainContext *context) +static void tcp_chr_update_read_handler(Chardev *chr) { SocketChardev *s =3D SOCKET_CHARDEV(chr); =20 diff --git a/chardev/char-udp.c b/chardev/char-udp.c index 106dee1..d46ff7a 100644 --- a/chardev/char-udp.c +++ b/chardev/char-udp.c @@ -100,8 +100,7 @@ static gboolean udp_chr_read(QIOChannel *chan, GIOCondi= tion cond, void *opaque) return TRUE; } =20 -static void udp_chr_update_read_handler(Chardev *chr, - GMainContext *context) +static void udp_chr_update_read_handler(Chardev *chr) { UdpChardev *s =3D UDP_CHARDEV(chr); =20 diff --git a/include/chardev/char.h b/include/chardev/char.h index 84fb773..43aabcc 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -238,7 +238,7 @@ typedef struct ChardevClass { int (*chr_write)(Chardev *s, const uint8_t *buf, int len); int (*chr_sync_read)(Chardev *s, const uint8_t *buf, int len); GSource *(*chr_add_watch)(Chardev *s, GIOCondition cond); - void (*chr_update_read_handler)(Chardev *s, GMainContext *context); + void (*chr_update_read_handler)(Chardev *s); int (*chr_ioctl)(Chardev *s, int cmd, void *arg); int (*get_msgfds)(Chardev *s, int* fds, int num); int (*set_msgfds)(Chardev *s, int *fds, int num); --=20 2.7.4