public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v4 3/3] guestfs: Per-user storage pools
Date: Thu, 24 Apr 2025 10:17:25 -0400	[thread overview]
Message-ID: <20250424141725.827244-4-cel@kernel.org> (raw)
In-Reply-To: <20250424141725.827244-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

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 <mcgrof@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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


      parent reply	other threads:[~2025-04-24 14:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 14:17 [PATCH v4 0/3] Add uniquifier to storage pool path cel
2025-04-24 14:17 ` [PATCH v4 1/3] scripts: Remove unused kdevops_storage_pool_user variable cel
2025-04-24 14:17 ` [PATCH v4 2/3] Kconfig: Define KDEVOPS_STORAGE_POOL_USER via Kconfig cel
2025-04-24 14:17 ` cel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250424141725.827244-4-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox