From patchwork Sun Nov 8 14:59:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 11889675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBB3B139F for ; Sun, 8 Nov 2020 15:01:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9592206F4 for ; Sun, 8 Nov 2020 15:01:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9592206F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org 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 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 21697.48037; Sun, 08 Nov 2020 15:00:00 +0000 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" 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 X-Inumbo-ID: 81181a72-5ac7-4ec6-831a-ea95dcef0c5f 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 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: 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) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-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 Organization: Invisible Things Lab 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órecki 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_device.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 == 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); } rc = libxl__xs_transaction_commit(gc, &t);