From nobody Sun Feb 8 19:54:39 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=quarantine dis=quarantine) header.from=openvz.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1702901284197906.0918007722307; Mon, 18 Dec 2023 04:08:04 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 245C319D2; Mon, 18 Dec 2023 07:08:03 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DF1C61B8E; Mon, 18 Dec 2023 07:03:26 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4F30B1A76; Mon, 18 Dec 2023 07:01:44 -0500 (EST) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 36D161A7A for ; Mon, 18 Dec 2023 07:01:43 -0500 (EST) Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=iris.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1rFC1t-0020fq-1n; Mon, 18 Dec 2023 12:45:23 +0100 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 From: "Denis V. Lunev" To: devel@lists.libvirt.org Subject: [PATCH 1/3] rpc: create virNetClientIOWakeup helper Date: Mon, 18 Dec 2023 12:45:28 +0100 Message-Id: <20231218114530.29326-2-den@openvz.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231218114530.29326-1-den@openvz.org> References: <20231218114530.29326-1-den@openvz.org> MIME-Version: 1.0 X-MailFrom: den@openvz.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: JQBFKHYT37KOL6TIWHV232FJG7PYWLJE X-Message-ID-Hash: JQBFKHYT37KOL6TIWHV232FJG7PYWLJE X-Mailman-Approved-At: Mon, 18 Dec 2023 12:02:50 -0500 CC: den@openvz.org, efim.shevrin@virtuozzo.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1702901286077100001 This functionality is to be extended, simple call to g_main_loop_quit() is not enough. In order to make changes convinient, the helper is required. Signed-off-by: Denis V. Lunev --- src/rpc/virnetclient.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index d29917df27..d9a508246f 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -150,6 +150,13 @@ void virNetClientSetCloseCallback(virNetClient *client, } =20 =20 +static void +virNetClientIOWakeup(virNetClient *client) +{ + g_main_loop_quit(client->eventLoop); +} + + static void virNetClientIncomingEvent(virNetSocket *sock, int events, void *opaque); @@ -851,7 +858,7 @@ static void virNetClientCloseInternal(virNetClient *cli= ent, * queue and close the client because we set client->wantClose. */ if (client->haveTheBuck) { - g_main_loop_quit(client->eventLoop); + virNetClientIOWakeup(client); } else { virNetClientIOEventLoopPassTheBuck(client, NULL); } @@ -918,7 +925,7 @@ virNetClientIOEventTLS(int fd G_GNUC_UNUSED, virNetClient *client =3D opaque; =20 if (!virNetClientTLSHandshake(client)) - g_main_loop_quit(client->eventLoop); + virNetClientIOWakeup(client); =20 return G_SOURCE_REMOVE; } @@ -931,7 +938,7 @@ virNetClientIOEventTLSConfirm(int fd G_GNUC_UNUSED, { virNetClient *client =3D opaque; =20 - g_main_loop_quit(client->eventLoop); + virNetClientIOWakeup(client); =20 return G_SOURCE_REMOVE; } @@ -1675,7 +1682,7 @@ virNetClientIOEventFD(int fd G_GNUC_UNUSED, { struct virNetClientIOEventData *data =3D opaque; data->rev =3D ev; - g_main_loop_quit(data->client->eventLoop); + virNetClientIOWakeup(data->client); return G_SOURCE_REMOVE; } =20 @@ -2006,8 +2013,7 @@ static int virNetClientIO(virNetClient *client, =20 /* Check to see if another thread is dispatching */ if (client->haveTheBuck) { - /* Force other thread to wakeup from poll */ - g_main_loop_quit(client->eventLoop); + virNetClientIOWakeup(client); =20 /* If we are non-blocking, detach the thread and keep the call in = the * queue. */ --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org