From nobody Sat May 4 19:31:02 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1578213780; cv=none; d=zohomail.com; s=zohoarc; b=T3h81aWkFNh71orUqSgLrtdQ4NYtVnQiwzlkyLztrQlKuErdeLBa1oLMk7pB36osJA8FXVANFAWgIhm/vaUnVWXKGGXReF4q8z1kYSxAENRTGjdZbDBgDz8TDS8IA7Pp21NTqzcWrw6jmFPrQ187hM/O2HPbERPrPM4jvc4BQgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578213780; 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=DlV7oH3Eiw188Vy4E4gllQy8R13xLbzBGAsDjj9YvZ8=; b=VU6mGTYKp/DEW2/XWJPEV8ws0cDVxBRSOBEbX0fZfilHNQUfQ44pvuo94gjhykq/YEZNHD1mU1YeCiTGgzQaFZv8LyycvmxyBXbL0Xsrkp5XtCIPPA9/ttzFyfVA8EzBlot1+Y0hXDmmLLHAtoqu+aDsQ7afjNqkaeBrRY5zj8M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1578213780067116.23412275650651; Sun, 5 Jan 2020 00:43:00 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1io1U1-0003eY-Ob; Sun, 05 Jan 2020 08:42:01 +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.89) (envelope-from ) id 1io1U0-0003eT-Oj for xen-devel@lists.xenproject.org; Sun, 05 Jan 2020 08:42:01 +0000 Received: from out1-smtp.messagingengine.com (unknown [66.111.4.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3cd5a734-2f97-11ea-a9e8-12813bfff9fa; Sun, 05 Jan 2020 08:41:59 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6417C213F4; Sun, 5 Jan 2020 03:41:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 05 Jan 2020 03:41:59 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 4526B8005C; Sun, 5 Jan 2020 03:41:58 -0500 (EST) X-Inumbo-ID: 3cd5a734-2f97-11ea-a9e8-12813bfff9fa 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=cFKggE N7I6PoOpeHPDc+9HU2Tt+TdkmmX1jxkCeENl8=; b=Wqa0f9VcIgJ64PchFOTGeB 2ItWE4KLM6IXd1L1OTxTyBTomd3JS+LqT4GhlaqRxX5Ur68VfRKjivoL3Vb4Uy1t Xecb8QUJ3MaRJZojzt2Ub3GHZSrWsm5gTermL3w3Sm6eWvdhwS32mZScuDE8W2m7 SBc9dBFPiT5G7jx5PfAFA/3ll94fqZw2/NKr+pRRmkwu4kT2DJTdylsNWWL3nQ2v jchKyJyCIrqvnCGs9RvbrdPJ/5nNJwA+W8op382AcLxFqrQ5M6Uw1pGEdbhBeaMh /5LC50CSjl3sxPyCDNwPnE+ptGSsmmBkNYzY8ALXdtTD25lmLogxMIy5C78QtJLQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdegjedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtohfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Sun, 5 Jan 2020 09:41:48 +0100 Message-Id: <20200105084148.18887-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Organization: Invisible Things Lab Subject: [Xen-devel] [PATCH] libxl: create backend/ xenstore dir for driver domains X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Cleaning up backend xenstore entries is a responsibility of the backend. When backend lives outside of dom0, the domain needs proper permissions to do it. Normally it is given permission to remove the device dir itself, but not the dir containing it (named after frontend ID). After a whole those empty leftover directories accumulate to the point xenstore returning E2BIG on listing them. Fix this by giving backend domain write access also to backend/ directory itself when c_info->driver_domain option is set. The code removing relevant dir is already there (just lacked permissions to do so). Note this also allows the backend domain to create new entries, pretending to host backend devices it don't have. But since libxl uses /libxl/ xenstore dir for this information (still outside of backend domain control), this shouldn't be an issue. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- tools/libxl/libxl_create.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index a6d40b753e..38ca9b85a4 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -763,6 +763,13 @@ retry_transaction: */ libxl__xs_mknod(gc, t, GCSPRINTF("%s/device-model", dom_path), rwp= erm, ARRAY_SIZE(rwperm)); + + /* + * Create a local "backend" directory for each guest, writable by = that + * guest, to allow it properly cleanup removed devices + */ + libxl__xs_mknod(gc, t, GCSPRINTF("%s/backend", dom_path), rwperm, + ARRAY_SIZE(rwperm)); } =20 vm_list =3D libxl_list_vm(ctx, &nb_vm); --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel