From: Scott Mayhew <smayhew@redhat.com>
To: cel@kernel.org
Cc: kdevops@lists.linux.dev, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [RFC PATCH] guestfs: Per-user storage pools
Date: Fri, 6 Sep 2024 16:10:12 -0400 [thread overview]
Message-ID: <ZtthpNjRJSS4qxu_@aion> (raw)
In-Reply-To: <20240906182641.471661-1-cel@kernel.org>
On Fri, 06 Sep 2024, cel@kernel.org wrote:
> 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 change 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, replace the "kdevops" string in the storage pool path with
> the name of the user account running kdevops.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Why don't you just include your user id in
CONFIG_KDEVOPS_STORAGE_POOL_PATH? That's what Jeff and I did when he
was still at Red Hat and we never ran into issues.
-Scott
> ---
> scripts/bringup_guestfs.sh | 2 +-
> scripts/destroy_guestfs.sh | 2 +-
> scripts/guestfs.Makefile | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> I'm not sure this is the best way to go about it, but this has
> worked well for several weeks. Looking for comments and
> suggestions!
>
>
> diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
> index 0cd573ae187b..1c042d5f8b84 100755
> --- a/scripts/bringup_guestfs.sh
> +++ b/scripts/bringup_guestfs.sh
> @@ -24,7 +24,7 @@ IMG_FMT="qcow2"
> if [ "${CONFIG_LIBVIRT_EXTRA_DRIVE_FORMAT_RAW}" = "y" ]; then
> IMG_FMT="raw"
> fi
> -STORAGEDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/kdevops/guestfs"
> +STORAGEDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/${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 3cdd21a83903..6daff3479250 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_KDEVOPS_STORAGE_POOL_PATH}/kdevops/guestfs"
> +STORAGEDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/${USER}/guestfs"
> GUESTFSDIR="${TOPDIR}/guestfs"
>
> if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then
> diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile
> index af901b8ddaa0..147389fd0534 100644
> --- a/scripts/guestfs.Makefile
> +++ b/scripts/guestfs.Makefile
> @@ -20,7 +20,7 @@ GUESTFS_ARGS += kdevops_storage_pool_group='$(QEMU_GROUP)'
> GUESTFS_ARGS += storage_pool_group='$(QEMU_GROUP)'
>
> STORAGE_POOL_PATH:=$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))
> -KDEVOPS_STORAGE_POOL_PATH:=$(STORAGE_POOL_PATH)/kdevops
> +KDEVOPS_STORAGE_POOL_PATH:=$(STORAGE_POOL_PATH)/$(USER)
> GUESTFS_ARGS += storage_pool_path=$(STORAGE_POOL_PATH)
> GUESTFS_ARGS += kdevops_storage_pool_path=$(KDEVOPS_STORAGE_POOL_PATH)
>
> @@ -84,4 +84,4 @@ destroy_guestfs:
> PHONY += destroy_guestfs
>
> cleancache:
> - $(Q)rm -f $(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/*
> + $(Q)rm -f $(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))/$(USER)/guestfs/base_images/*
> --
> 2.46.0
>
>
next prev parent reply other threads:[~2024-09-06 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 18:26 [RFC PATCH] guestfs: Per-user storage pools cel
2024-09-06 20:10 ` Scott Mayhew [this message]
2024-09-06 20:57 ` Chuck Lever
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=ZtthpNjRJSS4qxu_@aion \
--to=smayhew@redhat.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox