From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10B3B1A4F1F for ; Thu, 24 Apr 2025 14:17:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745504250; cv=none; b=gdtql4Ry1agdhH3b2PMysoGk5YvEKaWlCTvxKCLvlThMj5MWgj9a3neY4uZ9+7LHN70wRWFr3kH0eTRswlk/pngw9GavxSm/Ma9BK2s7f4yULe7kvB718ZStgw9KikLkJMG7FdSYxEVHJ7+3XaxN3JAY3qISvCEaxyIji+JfjS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745504250; c=relaxed/simple; bh=GXH+iaQp2ngiJaV3+PKNqdYLsAjwgqSdmBA3Uk/Nzkk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZBcYvVy/ddFr8ImxTgyFANY+ahO700i8z1NK6+cSn3ZFJhUCJdJGVDnBST/KXXFaqQVbbC4afi31kcQX7ehxuQXYZ9QgCws0CUUx5xduBNwjbjK1dGovxRINvrc/wNeaT4+ky6p3l8tgYNX1rsgeb96pjrLcwcfm1lb+X4Q1JWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JCCM/L6S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JCCM/L6S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A885C4CEED; Thu, 24 Apr 2025 14:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745504249; bh=GXH+iaQp2ngiJaV3+PKNqdYLsAjwgqSdmBA3Uk/Nzkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCCM/L6S6WvQvtFyljtQbJxw+zoM3R9UMn++VJAclsA1s6Dh1+DK15NU96hZgqN70 fBhldE1COOjRIB59momxnfbpPKOor27VO+fzz4ySespgqX6r1E/OL3CvQ3LjuOkqDb EU0Voq+pGw2v2Bz74122RiMbamolJpGga9kSYZK9m+TR6rwJ1QoABSZiDuElE2IYvR Wl4B+UeLChxnQJXThIclxkr3rXepfh5GzH60AtEOe2FGezxsvMZjOKuijFDGo22ncB /TrdjDl7IJbun+E2qhV/pJBOJkV3Bpyta88j+tHTf3PKWhXWiNN8BgK1IWeEYmUkNL ZA78S+O32Y3pA== From: cel@kernel.org To: Cc: Chuck Lever , Luis Chamberlain Subject: [PATCH v4 3/3] guestfs: Per-user storage pools Date: Thu, 24 Apr 2025 10:17:25 -0400 Message-ID: <20250424141725.827244-4-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250424141725.827244-1-cel@kernel.org> References: <20250424141725.827244-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever I'd like to be able to run more than one instance of kdevops per physical host. Currently the kdevops guestfs set-up steers all storage pool activity into ${STORAGE_POOL}/kdevops/guestfs, which means there's a good chance that two different logged-in users will create virtual machines whose names (and block devices) conflict. So far I haven't been able to get the other storage pool-related settings to add sufficient uniqueness to prevent this conflict. Instead, optionally replace the "kdevops" string in the storage pool path with the name of the user account running kdevops. Default behavior is to continue using "kdevops". Suggested-by: Luis Chamberlain Signed-off-by: Chuck Lever --- kconfigs/Kconfig.libvirt | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/kconfigs/Kconfig.libvirt b/kconfigs/Kconfig.libvirt index 04abadff4e5b..14620c9d21c4 100644 --- a/kconfigs/Kconfig.libvirt +++ b/kconfigs/Kconfig.libvirt @@ -1099,10 +1099,47 @@ config LIBVIRT_STORAGE_POOL_NAME For instance you may want to use a volume name of "data2" for a path on a partition on /data2/ or something like that. +choice + prompt "Storage pool user name to use" + default KDEVOPS_STORAGE_POOL_USER_DEFAULT + help + The storage pool user is name of the local user ID that has + access to the libvirt storage pool to be used by kdevops. + + When there is only one user running kdevops on a system, + the default setting should work. To enable multiple users + to run kdevops on the same system, select + KDEVOPS_STORAGE_POOL_USER_AUTO. + +config KDEVOPS_STORAGE_POOL_USER_DEFAULT + bool "default" + help + The default storage pool user name is always "kdevops". + +config KDEVOPS_STORAGE_POOL_USER_AUTO + bool "auto" + help + Kdevops selects the storage pool user name. + +config KDEVOPS_STORAGE_POOL_USER_CUSTOM + bool "custom" + help + Set a fixed custom storage pool user name. + +endchoice + +config KDEVOPS_STORAGE_POOL_USER_CUSTOM_NAME + string "Storage pool user name" + depends on KDEVOPS_STORAGE_POOL_USER_CUSTOM + help + Set the name of the storage pool user. + config KDEVOPS_STORAGE_POOL_USER string output yaml - default "kdevops" + default "kdevops" if KDEVOPS_STORAGE_POOL_USER_DEFAULT + default $(shell, echo $USER) if KDEVOPS_STORAGE_POOL_USER_AUTO + default KDEVOPS_STORAGE_POOL_USER_CUSTOM_NAME if KDEVOPS_STORAGE_POOL_USER_CUSTOM config KDEVOPS_STORAGE_POOL_PATH string -- 2.49.0