All of lore.kernel.org
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v4 2/3] Kconfig: Define KDEVOPS_STORAGE_POOL_USER via Kconfig
Date: Thu, 24 Apr 2025 10:17:24 -0400	[thread overview]
Message-ID: <20250424141725.827244-3-cel@kernel.org> (raw)
In-Reply-To: <20250424141725.827244-1-cel@kernel.org>

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

Prepare to replace the "kdevops" string in the storage pool path
with the name of the user account running kdevops. First step is to
define a Kconfig variable for the storage pool user. For the moment,
the storage pool user name defaults to the same string it is
currently.

I would love for there to be a way to provide an actual pathname in
CONFIG_KDEVOPS_STORAGE_POOL_PATH. I haven't found a way so far.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 kconfigs/Kconfig.libvirt   | 15 ++++++++++-----
 scripts/bringup_guestfs.sh |  3 +--
 scripts/destroy_guestfs.sh |  2 +-
 scripts/guestfs.Makefile   |  2 +-
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/kconfigs/Kconfig.libvirt b/kconfigs/Kconfig.libvirt
index cba8abf1e24b..04abadff4e5b 100644
--- a/kconfigs/Kconfig.libvirt
+++ b/kconfigs/Kconfig.libvirt
@@ -164,11 +164,6 @@ config LIBVIRT_STORAGE_POOL_PATH
 	default LIBVIRT_STORAGE_POOL_PATH_CUSTOM if LIBVIRT && LIBVIRT_STORAGE_POOL_PATH_CUSTOM_MANUAL
 	default VIRTUALBOX_STORAGE_POOL_PATH_CUSTOM if VAGRANT_VIRTUALBOX
 
-config KDEVOPS_STORAGE_POOL_PATH
-	string
-	output yaml
-	default "{{ libvirt_storage_pool_path }}/kdevops"
-
 config QEMU_BIN_PATH
 	string
 	default QEMU_BIN_PATH_LIBVIRT if LIBVIRT
@@ -1104,6 +1099,16 @@ 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.
 
+config KDEVOPS_STORAGE_POOL_USER
+	string
+	output yaml
+	default "kdevops"
+
+config KDEVOPS_STORAGE_POOL_PATH
+	string
+	output yaml
+	default "{{ libvirt_storage_pool_path }}/{{ kdevops_storage_pool_user }}"
+
 source "kconfigs/Kconfig.libvirt.zns"
 source "kconfigs/Kconfig.libvirt.largeio"
 source "kconfigs/Kconfig.libvirt.cxl"
diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
index 94e0437192be..3ac99bf9f22a 100755
--- a/scripts/bringup_guestfs.sh
+++ b/scripts/bringup_guestfs.sh
@@ -14,8 +14,7 @@ IMG_FMT="qcow2"
 if [ "${CONFIG_LIBVIRT_EXTRA_DRIVE_FORMAT_RAW}" = "y" ]; then
 	IMG_FMT="raw"
 fi
-STORAGETOPDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}"
-STORAGEDIR="${STORAGETOPDIR}/kdevops/guestfs"
+STORAGEDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/${CONFIG_KDEVOPS_STORAGE_POOL_USER}/guestfs"
 QEMU_GROUP=$CONFIG_LIBVIRT_QEMU_GROUP
 GUESTFSDIR="${TOPDIR}/guestfs"
 OS_VERSION=${CONFIG_VIRT_BUILDER_OS_VERSION}
diff --git a/scripts/destroy_guestfs.sh b/scripts/destroy_guestfs.sh
index ee5dc2b57d6d..dfbb4f15f4ca 100755
--- a/scripts/destroy_guestfs.sh
+++ b/scripts/destroy_guestfs.sh
@@ -7,7 +7,7 @@ source ${TOPDIR}/scripts/lib.sh
 
 export LIBVIRT_DEFAULT_URI=$CONFIG_LIBVIRT_URI
 
-STORAGEDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/kdevops/guestfs"
+STORAGEDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/${CONFIG_KDEVOPS_STORAGE_POOL_USER}/guestfs"
 GUESTFSDIR="${TOPDIR}/guestfs"
 
 if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then
diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile
index 43bbea4fda2e..8d4aac3e3669 100644
--- a/scripts/guestfs.Makefile
+++ b/scripts/guestfs.Makefile
@@ -99,4 +99,4 @@ destroy_guestfs:
 PHONY += destroy_guestfs
 
 cleancache:
-	$(Q)rm -f $(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/*
+	$(Q)rm -f $(CONFIG_LIBVIRT_STORAGE_POOL_PATH)/$(CONFIG_KDEVOPS_STORAGE_POOL_USER)/guestfs/base_images/*
-- 
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 ` cel [this message]
2025-04-24 14:17 ` [PATCH v4 3/3] guestfs: Per-user storage pools cel

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-3-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.