From nobody Thu Sep 19 01:09:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1719559727945486.24738620575465; Fri, 28 Jun 2024 00:28:47 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E80AF1256; Fri, 28 Jun 2024 03:28:46 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 8E52A1403; Fri, 28 Jun 2024 03:27:04 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 387F6E3B; Fri, 28 Jun 2024 03:26:52 -0400 (EDT) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lists.libvirt.org (Postfix) with ESMTP id 58F8E110A for ; Fri, 28 Jun 2024 03:26:51 -0400 (EDT) Received: from paekkaladevi-dev-u22.gi4irqh5pfqublruu4yyku2wof.phxx.internal.cloudapp.net (unknown [20.125.125.171]) by linux.microsoft.com (Postfix) with ESMTPSA id B2A1620B7013; Fri, 28 Jun 2024 00:26:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B2A1620B7013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1719559610; bh=eaMM5ucKLJk0YRNon8VT65M8f2bLXULYxr+KjuDFC+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UsQg4NV0mxrDH2uCGgNJ10FlNWfycOSbJQUDyt0dVkOK2A5GU9vxGl6tqPOi+Hje3 VBeO1QA3qOGiOX7aJvB3JGdLy8yTH31WPUZzCrULjjDNEOsfmtheG40KIBctuwmsp6 NbvnwEU4Ekik+EiylOBMED41MQW5yKoH3bN1Z168= From: Purna Pavan Chandra To: devel@lists.libvirt.org Subject: [PATCH 4/8] ch: poll with -1 in chSocketRecv Date: Fri, 28 Jun 2024 07:26:43 +0000 Message-Id: <20240628072647.2674-5-paekkaladevi@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240628072647.2674-1-paekkaladevi@linux.microsoft.com> References: <20240628072647.2674-1-paekkaladevi@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 3REJNWD3EB4GLFFSPQZNDEVJZ4ZMGN7N X-Message-ID-Hash: 3REJNWD3EB4GLFFSPQZNDEVJZ4ZMGN7N X-MailFrom: paekkaladevi@linux.microsoft.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: paekkaladevi@microsoft.com, prapal@linux.microsoft.com, liuwe@microsoft.com, kumarpraveen@linux.microsoft.com, Purna Pavan Chandra 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: X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1719559728232100001 Content-Type: text/plain; charset="utf-8" chSocketRecv fn can be used by operations such as restore, which cannot have a specific poll timeout. The runtime of these operations at server side (vmm) cannot be determined or capped as it depends on the guest configuration. Hence, pass -1 as timeout to poll to make wait until there's a response from server. Signed-off-by: Purna Pavan Chandra --- src/ch/ch_process.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 668a53a1c2..3f2a3f81e5 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -530,9 +530,6 @@ chMonitorSocketConnect(virCHMonitor *mon) return -1; } =20 - -#define PKT_TIMEOUT_MS 500 /* ms */ - static char * chSocketRecv(int sock) { @@ -547,7 +544,7 @@ chSocketRecv(int sock) pfds[0].events =3D POLLIN; =20 do { - ret =3D poll(pfds, G_N_ELEMENTS(pfds), PKT_TIMEOUT_MS); + ret =3D poll(pfds, G_N_ELEMENTS(pfds), -1); } while (ret < 0 && errno =3D=3D EINTR); =20 if (ret <=3D 0) { @@ -571,8 +568,6 @@ chSocketRecv(int sock) return g_steal_pointer(&buf); } =20 -#undef PKT_TIMEOUT_MS - static int chSocketProcessHttpResponse(int sock) { --=20 2.34.1