From nobody Fri Apr 26 02:25:23 2024 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1604847644; cv=none; d=zohomail.com; s=zohoarc; b=lYDFvj/kIwZqJn4Eo/jE6FD8ZOtL3EywfOPv2eILUpouIWkDQISnxdKZ4COjPjPQl4/7ZxCLW/n+sx8GTLts8OyDPbOzTWN/ZRE3+3nMzqW055aSmoM9IR5B0+EQo63EpbY1y8KFB+/TMkCJLO2uIbSZOBusjMIoSBUSi45yx9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604847644; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Dr/Os47m39uIrlvoJNAUFN0AyThOrdYx72S+jUYJCb8=; b=J6hcZeAtQOQOgBgr7rud7bLfDgvs3WFLi3QbK4ctHNtoZwtH+bZvMH5NLIc5ttSSJTZWT0X2w4KQHClwyyO3EDrK5bKKRkYSriR9/r8A5V48Jke34/PInmikFVbtm+nc6R0bblmiZCOj/m7bRYfT5M5oaj2U/0x8WW5qGPNkJ+c= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1604847643987168.13784130339513; Sun, 8 Nov 2020 07:00:43 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.21697.48037 (Exim 4.92) (envelope-from ) id 1kbmAi-0004yN-3I; Sun, 08 Nov 2020 15:00:00 +0000 Received: by outflank-mailman (output) from mailman id 21697.48037; Sun, 08 Nov 2020 15:00: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 1kbmAi-0004yG-0C; Sun, 08 Nov 2020 15:00:00 +0000 Received: by outflank-mailman (input) for mailman id 21697; Sun, 08 Nov 2020 14:59:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kbmAg-0004yB-Q6 for xen-devel@lists.xenproject.org; Sun, 08 Nov 2020 14:59:59 +0000 Received: from wout2-smtp.messagingengine.com (unknown [64.147.123.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 81181a72-5ac7-4ec6-831a-ea95dcef0c5f; Sun, 08 Nov 2020 14:59:57 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id AB6F454C; Sun, 8 Nov 2020 09:59:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 08 Nov 2020 09:59:57 -0500 Received: from localhost.localdomain (ip5b40aa59.dynamic.kabel-deutschland.de [91.64.170.89]) by mail.messagingengine.com (Postfix) with ESMTPA id EB4F4328005E; Sun, 8 Nov 2020 09:59:54 -0500 (EST) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kbmAg-0004yB-Q6 for xen-devel@lists.xenproject.org; Sun, 08 Nov 2020 14:59:59 +0000 Received: from wout2-smtp.messagingengine.com (unknown [64.147.123.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 81181a72-5ac7-4ec6-831a-ea95dcef0c5f; Sun, 08 Nov 2020 14:59:57 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id AB6F454C; Sun, 8 Nov 2020 09:59:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 08 Nov 2020 09:59:57 -0500 Received: from localhost.localdomain (ip5b40aa59.dynamic.kabel-deutschland.de [91.64.170.89]) by mail.messagingengine.com (Postfix) with ESMTPA id EB4F4328005E; Sun, 8 Nov 2020 09:59:54 -0500 (EST) 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: 81181a72-5ac7-4ec6-831a-ea95dcef0c5f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Dr/Os4 7m39uIrlvoJNAUFN0AyThOrdYx72S+jUYJCb8=; b=B0jkmDcLb5IQ2Yv6JtJ1cQ VcX2jJZnjA9aeylCKlJeypV36DsIo74oqarEl/GJ5Gadf+BkdcQFhmN6WlT5LRIE W+xa3J2esBghgvRsFW/Jg5KjTCiWPcXcuerYhzZIdlx0yh1MU5AVv9OoxcxfpVLX 6OBkLjE2tbO/sCWID5IpLPvHQwWggbChFZIau2P0SvPWs/cN8aBuHa5PDbZi/L4y 9R/18YeGqSviaTNCCsBIdeQSfCVnI5zJamTZVsvdvB+V+RQa6anlQNVf571Gtg9W 93yT8p6nXbwCORjyy5Qt4nz41ERylnzVGkKTJPKU5+qbJQL9yx0JVbcptnfLiLhg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddufedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtohfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetgeet keeukeffhfejueeludehtedtkeeuiedtgffgtdfhveefueeiiefhudehgeenucfkpheple durdeigedrudejtddrkeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsg drtghomh X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Ian Jackson , Wei Liu , Anthony PERARD Subject: [PATCH] libxl: cleanup remaining backend xs dirs after driver domain Date: Sun, 8 Nov 2020 15:59:42 +0100 Message-Id: <20201108145942.3089012-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Organization: Invisible Things Lab Content-Transfer-Encoding: quoted-printable When device is removed, backend domain (which may be a driver domain) is responsible for removing backend entries from xenstore. But in case of driver domain, it has no access to remove all of them - specifically the directory named after frontend-id remains. This may accumulate enough to exceed xenstore quote of the driver domain, breaking further devices. Fix this by calling libxl__xs_path_cleanup() on the backend path from libxl__device_destroy() in the toolstack domain too. Note libxl__device_destroy() is called when the driver domain already removed what it can (see device_destroy_be_watch_cb()->device_hotplug_done()). Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu --- tools/libs/light/libxl_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/libs/light/libxl_device.c b/tools/libs/light/libxl_devic= e.c index e081faf9a94e..f131a6c822c6 100644 --- a/tools/libs/light/libxl_device.c +++ b/tools/libs/light/libxl_device.c @@ -763,6 +763,12 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device= *dev) * from the backend path. */ libxl__xs_path_cleanup(gc, t, be_path); + } else if (domid =3D=3D LIBXL_TOOLSTACK_DOMID && !libxl_only) { + /* + * Then, toolstack domain is in charge of removing the parent + * directory if empty already. + */ + libxl__xs_path_cleanup(gc, t, be_path); } =20 rc =3D libxl__xs_transaction_commit(gc, &t); --=20 2.25.4