From nobody Fri Mar 29 00:06:01 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=1619483046; cv=none; d=zohomail.com; s=zohoarc; b=hqBzUcBumpl53Wqb3PaSqs9bxK8tG0375x2mpR0tyJB+gMgrDadMOtJ9L8q4uwBBiANuLZaulzmHjbEiwu/gi/d1a0wx3Dn5ampZj3dvY5UWT00IWMUjJjNXkUWPyL2SzhfLPPjRRPgmkg0YFAAscJpA7GOt7tZFSP0k4nvEngc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619483046; 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=gATBZhf8O/GcC36i+t7uFp1kBc9s8YNPkw1529oUZ4k=; b=F9E+AMF+bbrsXHGa0r4whcGMpeahIVDXQyU0VBrSVUGqYchIlnAiAa0Jy/R4QvSc7+x4IbHqhUk6M9+lJU9Pw8cEwmNDkUYReEOKUccu028t/mHU7KjUdkhUDW2VuFy9x03BE1wZ1cwziL2KOGxUbjTZoAuZcPMSDNR/ZIlFcMc= 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 1619483046858641.1729202529574; Mon, 26 Apr 2021 17:24:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.117945.223875 (Exim 4.92) (envelope-from ) id 1lbBVu-0007o4-Nc; Tue, 27 Apr 2021 00:23:42 +0000 Received: by outflank-mailman (output) from mailman id 117945.223875; Tue, 27 Apr 2021 00:23:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbBVu-0007nx-KG; Tue, 27 Apr 2021 00:23:42 +0000 Received: by outflank-mailman (input) for mailman id 117945; Tue, 27 Apr 2021 00:23:41 +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 1lbBVt-0007mO-Hv for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 00:23:41 +0000 Received: from out1-smtp.messagingengine.com (unknown [66.111.4.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id ff006c37-d6e3-459e-b112-eb77e50d2c5c; Tue, 27 Apr 2021 00:23:36 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 8D7155C0186; Mon, 26 Apr 2021 20:23:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 26 Apr 2021 20:23:36 -0400 Received: from localhost.localdomain (ip5b434f04.dynamic.kabel-deutschland.de [91.67.79.4]) by mail.messagingengine.com (Postfix) with ESMTPA id CFF411080069; Mon, 26 Apr 2021 20:23:35 -0400 (EDT) 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: ff006c37-d6e3-459e-b112-eb77e50d2c5c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=gATBZhf8O/GcC36i+t7uFp1kBc9s8YNPkw1529oUZ 4k=; b=jDabQXVSz8HPFf8uOdBIg9gjT4yW2qRtksPiEFN70PJUfAz2iyfxz531N ReTWL4PfGcVaPcSr7Yj0Lui4DFicUWIUG+KKWzDX9tSJ9/M95IUnJ0ienNfRZngb H7KGDywlK/6aoJu2ISk2CgOTyHkYTTpr7EXlMvEyMYANVFhCDe09C39yvheh+zyn xwHdK1xvgMVQjgIX+gjB90c0TMmTtRnXC0MjWGUg76p573/TNjS/kR4SzpgIXNlx X5CJZ/wQE/mjUvT/5+0RVYcKKINqAKwP7Idy/4lNGcrqLhHCTi6+Rallqqk54WzB YlfAbBD+A8qLcOCYkPfmcRnzGnj9Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdduledgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepkeff ieeiuedvudekgfetgfelveffhfeuieejgeelhefhteethedtheeuteekvdeinecukfhppe eluddrieejrdejledrgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrd gtohhm 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: [RFC PATCH 1/2] libxl: rename 'error' label to 'out' as it is used for success too Date: Tue, 27 Apr 2021 02:22:31 +0200 Message-Id: X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Marek Marczykowski-G=C3=B3recki --- tools/libs/light/libxl_linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libs/light/libxl_linux.c b/tools/libs/light/libxl_linux.c index 8d62dfd255cb..cc8baf5c3eae 100644 --- a/tools/libs/light/libxl_linux.c +++ b/tools/libs/light/libxl_linux.c @@ -174,14 +174,14 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__= device *dev, LOGEVD(ERROR, errno, dev->domid, "unable to read script from %s", be_path); rc =3D ERROR_FAIL; - goto error; + goto out; } =20 *env =3D get_hotplug_env(gc, script, dev); if (!*env) { LOGD(ERROR, dev->domid, "Failed to get hotplug environment"); rc =3D ERROR_FAIL; - goto error; + goto out; } =20 const int arraysize =3D 3; @@ -194,7 +194,7 @@ static int libxl__hotplug_disk(libxl__gc *gc, libxl__de= vice *dev, LOGD(DEBUG, dev->domid, "Args and environment ready"); rc =3D 1; =20 -error: +out: return rc; } =20 --=20 git-series 0.9.1 From nobody Fri Mar 29 00:06:01 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=1619483048; cv=none; d=zohomail.com; s=zohoarc; b=dLm2lcAKwqc1X/OaI9BmKsdptGpGYIJt9bZpYh894EaDe3Aw55cjQYAQGfXLkAkKZ1krcpnVnbuo6QcIL8uY58TW1VQjgQG6/t5YCTWsG+US8SOBt8jRDN/2+0VePsJge4Wxugh2Skzu1ba+Xwm7zEpF7mca3XFLZvqoJgk/cSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619483048; 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=c2QDLs+tJ379utFzbl/w+Nqe4CBOem8f00hNMpbEnbU=; b=NyUZJ35Bt+OjB9lRLWxUrkW+vb8nOykPlWB3GQgQTJXYy1YP9FU+KJPY54O2iIZukGFVy/rCGoo+L/MC7XzkBS2/44GMnhEIBzsquUDVgVaUcbphlY8kp8vPH8lssITYV9vt7E0uqyUv3g2xUKDC8RoL12D6TuRIpH1uDtb/d3k= 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 1619483048432337.86863964456677; Mon, 26 Apr 2021 17:24:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.117946.223887 (Exim 4.92) (envelope-from ) id 1lbBW0-0007r6-19; Tue, 27 Apr 2021 00:23:48 +0000 Received: by outflank-mailman (output) from mailman id 117946.223887; Tue, 27 Apr 2021 00:23:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lbBVz-0007qw-Tu; Tue, 27 Apr 2021 00:23:47 +0000 Received: by outflank-mailman (input) for mailman id 117946; Tue, 27 Apr 2021 00:23:46 +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 1lbBVy-0007mO-IG for xen-devel@lists.xenproject.org; Tue, 27 Apr 2021 00:23:46 +0000 Received: from out1-smtp.messagingengine.com (unknown [66.111.4.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8e946aa0-51b7-41c1-ac44-77d88261096f; Tue, 27 Apr 2021 00:23:37 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 798F45C017C; Mon, 26 Apr 2021 20:23:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 26 Apr 2021 20:23:37 -0400 Received: from localhost.localdomain (ip5b434f04.dynamic.kabel-deutschland.de [91.67.79.4]) by mail.messagingengine.com (Postfix) with ESMTPA id BAAD6108005F; Mon, 26 Apr 2021 20:23:36 -0400 (EDT) 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: 8e946aa0-51b7-41c1-ac44-77d88261096f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=c2QDLs+tJ379utFzbl/w+Nqe4CBOem8f00hNMpbEn bU=; b=AJXJHgSOQcqW0r01N3LcHa4VJa1gE4dtvghNkuJbrgkVZiecPzGKXSY/+ oCNM8kkzWcyyRfLg6xU7BUvLVZrWanIVNnXR4XPhT9Ospu+xOaxLE0CaYQHiKVGF hUjwR1ZcqKitWWxdKH5DmpViUCzinSivzI4K88vfsz/85YYJ3j2gD/hiC3s6EqPV Bv2510pdw0ap/aYRyFEmNrIYGMF6zWoPBCOl9bQWX5soNNDcGCtfESP9Z1iDaAF+ ygYtINZ68CNlibKCL0f2WLklhkO+4n1eijQ7bQznq7d5NLa9Rkx//vK4iRw/NNLQ wrvMBLtvjneE/ZSCoXbO2yuU40VRA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdduledgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgfei ueethfeivdetffetueeftdeileeiteeiudefveeugedvfeeggeeiudekteeunecuffhomh grihhnpehpohgurdhinhenucfkphepledurdeijedrjeelrdegnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvih hsihgslhgvthhhihhnghhslhgrsgdrtghomh 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: [RFC PATCH 2/2] libxl: allow to skip block script completely Date: Tue, 27 Apr 2021 02:22:32 +0200 Message-Id: <25fbb81f8f7805a390613521dadedaeab4cd4563.1619482896.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Default block script is quite slow and requires global lock which slows it down even more (for domains with multiple disks). The common case of a block device-based disk is trivial to handle and does not require locking. This can be handled directly within libxl, to avoid slow script execution and waiting for it to finish. This, depending on the hardware, may save about 0.5s of domain start time per disk. Allow setting script name to empty string to skip executing the script at all, and use target name as a block device path directly. This does skip two functions of the block script: - checking if device isn't used anywhere else (including mounted in dom0) - setting up loop device for a file-based disk The former is expected to be done by the operator manually (or by a higher level management stack, that calls into libxl). The later is a limitation of the current implementation, but should be possible to extend in the future. The code to fill 'physical-device' xenstore node is added via libxl__hotplug_disk() (in libxl_linux.c) intentionally. This code is called in device backend domain (which may be not dom0), contrary to device_disk_add() which fills all the other xenstore entries, but is called always in the toolstack domain (dom0). libxl__hoplug_disk() is called from libxl__get_hotplug_script_info(), which may not sound like the most logical place to actually change some state, but it is called when we need it. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- docs/man/xl-disk-configuration.5.pod.in | 4 ++- tools/libs/light/libxl_disk.c | 7 ++- tools/libs/light/libxl_linux.c | 62 ++++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/docs/man/xl-disk-configuration.5.pod.in b/docs/man/xl-disk-con= figuration.5.pod.in index 71d0e86e3d63..3b3b3c329e13 100644 --- a/docs/man/xl-disk-configuration.5.pod.in +++ b/docs/man/xl-disk-configuration.5.pod.in @@ -261,6 +261,10 @@ information to be interpreted by the executable progra= m I