From nobody Mon Feb 9 06:07:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1610749816; cv=none; d=zohomail.com; s=zohoarc; b=gzt4Qjf5UWgwKQdZksom9qUiUYRE57bcToH3jbPvkyxP7q7fN3XEqSOwsmYsaH3b+nBPpdyQ00pWCfy+PZA0DL04I0O+ohKK0smGW1N7K3hEAZqgP3wM8SX2h0iHybd6Dp/guWnYIH1XKgYnsi70jGehu+ktF5VjgBcz/sYu/KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610749816; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yttEhKbPpkx5zXzKuGhxXeXAFaq8ad+G4VtLAPW8gbQ=; b=Aj5LoDg+AdQcknf8dvy0so5bAI6ES2VlrCOst4yOQnl1PV2DLsWLjlw6Ah1XYIzIXU9OIRaJGIWLSHC2fZeivDHZFTrwCwrNqGkCv4reLq9n4xtGyZXB7zcVYV77mi1Aw9Ul0nzqdMXl8awNvFZBZPFcLaVW98x85Aew5mStQuE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1610749816380277.32279323211696; Fri, 15 Jan 2021 14:30:16 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.68663.122980 (Exim 4.92) (envelope-from ) id 1l0XbU-0006DO-GW; Fri, 15 Jan 2021 22:30:00 +0000 Received: by outflank-mailman (output) from mailman id 68663.122980; Fri, 15 Jan 2021 22:30:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l0XbU-0006D7-2c; Fri, 15 Jan 2021 22:30:00 +0000 Received: by outflank-mailman (input) for mailman id 68663; Fri, 15 Jan 2021 22:29:59 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l0XbT-00062b-8E for xen-devel@lists.xenproject.org; Fri, 15 Jan 2021 22:29:59 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id d2e3b80d-86da-4705-9edf-f9c045ca9bf7; Fri, 15 Jan 2021 22:29:49 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d2e3b80d-86da-4705-9edf-f9c045ca9bf7 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1610749789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lWsFTTbEVFGdoUm4Dgm9YQNeIr4pWQkbL4RlcMnain4=; b=aWmEMoSXP/SabntwWj72+ReS/+rpbPyvcUEcyfpo2i4lPxppW7T29ZcK 6oGbtCUqMZt+kKNgK67XQY3e+AMtVeEHNpPjKEZpgKx4cDbQLddWZN797 ZwlNgS2+grx9pow5cQJeaLA6+WCYsxSmPAQyE4QJmScM7SC//ix4MRw2E 4=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: LqKnSJ01Vz6NbkjT5eTnpYW+v22/ib/w2FzMRwcnWFDPte6Sd4HtlfQTyfBwsBVBIQZ2qh6kQk K+U55Ebwd+zjAnMAvMtKufyGG8tRxQxG+n+7fzAe7QLe1KQNiKL8lTNKvnbUNm3sa+dTdnYcxm rqNxYp/2M3RSN2qY9gjVu4rqSjQCTiU/1xK4d43qADXtD3rupDpkjOIPOGSbm0d7OsDQRKxrEt HMqy15LOrIzhFMQB/YmFw068xVMF3mzDj50jggF/XSSTuMzI8YlwDunw6N89eHV08kNmYfY4yv U4k= X-SBRS: 5.1 X-MesageID: 35434450 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.79,350,1602561600"; d="scan'208";a="35434450" From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= To: CC: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= , Ian Jackson , Wei Liu , Juergen Gross , Pau Ruiz Safont , Christian Lindig Subject: [PATCH v2 2/8] Add workaround for xenstore-control flood issues Date: Fri, 15 Jan 2021 22:28:44 +0000 Message-ID: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) There are alternative fixes for this, e.g. do the entire live update inside oxenstored and reply OK from the next oxenstored or an error. This requires some asynchronous handling there. Once that code is available we can revert this one. Signed-off-by: Edwin T=C3=B6r=C3=B6k Reviewed-by: Pau Ruiz Safont Reviewed-by: Christian Lindig --- Changed since V1: * post publicly now that the XSA is out --- tools/xenstore/xenstore_control.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/xenstore/xenstore_control.c b/tools/xenstore/xenstore_co= ntrol.c index 5ca015a07d..611e8b4fdd 100644 --- a/tools/xenstore/xenstore_control.c +++ b/tools/xenstore/xenstore_control.c @@ -42,6 +42,10 @@ static int live_update_start(struct xs_handle *xsh, bool= force, unsigned int to) len =3D add_to_buf(&buf, "-F", len); if (len < 0) return 1; + /* +1 for rounding issues + * +1 to give oxenstored a chance to timeout and report back first + */ + to +=3D 2; =20 for (time_start =3D time(NULL); time(NULL) - time_start < to;) { ret =3D xs_control_command(xsh, "live-update", buf, len); @@ -49,6 +53,15 @@ static int live_update_start(struct xs_handle *xsh, bool= force, unsigned int to) goto err; if (strcmp(ret, "BUSY")) break; + /* TODO: use task ID for commands, avoid busy loop polling +here + * oxenstored checks BUSY condition internally on every main +loop iteration anyway. + * Avoid flooding xenstored with live-update requests. + * The flooding can also cause the evtchn to overflow in +xenstored which makes + * xenstored enter an infinite loop */ + sleep(1); } =20 if (strcmp(ret, "OK")) --=20 2.29.2