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 6EC515A79B for ; Fri, 6 Sep 2024 18:26:50 +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=1725647210; cv=none; b=fdltiSzarBatOFxqR5CkJbWnhf/xPIQ8F65xptVhuBVzF3XC8v1Wa7dwfVBHXsRDdHvJE4tis9NLvUIAVKmXwwwpSTApoKcqfbQWYEYKF2O6xQM3WnHrSy4vIdNx6T4FlgXJHARnQ80fS6QZQJ2KkdDUt6wEB/4T31q/ZGyQKUk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725647210; c=relaxed/simple; bh=HZ6rTylPcAAgEfehQrzkJTTKfiGfu3ayT69breQQQDk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VFtBA9DoeRevgQA3/SDfj+4bTc8Ll/uZZnZfaBp4bq5i0ZrDZYZUmEFQ5t5WL3bXTuXo+o8ON+G/H5w8oKMoDYW2LAVBgpWYJgbmGdC2A/hZm8AWFvSY1vAheiYolLSBxrkSMlyjHZ3h/n6qKAo5HnzZH4PrOzGU1MQgpmSv3g8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ECrpW2y2; 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="ECrpW2y2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C22ADC4CEC4; Fri, 6 Sep 2024 18:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725647210; bh=HZ6rTylPcAAgEfehQrzkJTTKfiGfu3ayT69breQQQDk=; h=From:To:Cc:Subject:Date:From; b=ECrpW2y296tvMYX28EG+pExZGkjSCfVUk4FAly87KW5IuSvtvl8XHP4epf/neHBBK xL0KiuzbeJM/wDYLnTenyfD9SncEnpN6ICK1WLFneNlsEk6RPsFpgxbfJQr0vg6f0V vlqjse8zWtHVi2OmdH6JUS6/wPwPIlsOm3tXuezKI0zpQpGtlJVRaT2bjLzRxfY+Uc eSXP+mE2sRdEgHfWAwQXYX/ryhiLgbVh10Zu+JN9XGhc1hEcxPhmJPLLbXI6K+XgCN TyNIuXJgZfBhgZcDYiiHqe3SDYp3I2Mj6mjHTNyWORmkFbZU71wLLyVa4kxMLjnp15 TpE76s4vbEDhw== From: cel@kernel.org To: Cc: Chuck Lever Subject: [RFC PATCH] guestfs: Per-user storage pools Date: Fri, 6 Sep 2024 14:26:41 -0400 Message-ID: <20240906182641.471661-1-cel@kernel.org> X-Mailer: git-send-email 2.46.0 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 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 --- 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