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 034382676C4 for ; Wed, 9 Apr 2025 15:23:38 +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=1744212219; cv=none; b=RoHrnhIhNsM25qJQ3vE6ZOB+FRjBScGB3AwTqliRuAk1gpZDa4RfPmOy4JlLory+kNvf1iR9mifvxZDNiq//i3B6mXwreO41SzNirBmXH6JKtdXpxYO17G/E/lEflcEaL17hm5KV5RmOomvZ4F1uc2AFGXcynkNSIIKq7PJjacs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744212219; c=relaxed/simple; bh=pbcIaCZx3wMkemLQVh3XM97jznV7UYL8m+6GPbK4th4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H6mxTTehZ3rAVOIA5Z9XqaLWvAdlLnBRNu4+ONY/KgUWtve7irseTqFd0xykH5qgrCXON1esONgchIm2qJqcctNXmgx0eJLFd3jSvGkZBSaV6PdwtDpdE/14dHeESoUEZaqK15+glgndH43TTUPuqglhL+o7YWSmTkO9oULLZnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RYXQOHpx; 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="RYXQOHpx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A8AC4CEE8; Wed, 9 Apr 2025 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744212218; bh=pbcIaCZx3wMkemLQVh3XM97jznV7UYL8m+6GPbK4th4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYXQOHpxgK2m46u97G+9evFNCt7+s4bycoWqY8YanOygXi03AeMDpcQe531GIWY4I wLhVs2FekJWu/dLF0375e0QC3H+iDL0d0gIMmnbbiQErpnXitWEWrvCnFwR0qEHEbf 58OWddDHK05u49v5K5bkvn1pYMgNGZnqew4XpBSwoR7/X2HiD6MKyeGMdkaH1yDF/K x6W50WY0s84ZbEObAb+TJn9idHI/J2FA+lpMzheTmN2imLSjF5rzcT8WgTRQC+7Rdh THydRkgF0NfvDNQ2wCJJQp+GOZL5K30t6CDQJOn06a9ZxxyaU0qZi0qCb502kZ9bey 5o1fInPWMZy7w== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v2 2/2] guestfs: Per-user storage pools Date: Wed, 9 Apr 2025 11:23:35 -0400 Message-ID: <20250409152335.890665-3-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250409152335.890665-1-cel@kernel.org> References: <20250409152335.890665-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 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 --- kconfigs/Kconfig.libvirt | 2 +- scripts/bringup_guestfs.sh | 2 +- scripts/destroy_guestfs.sh | 2 +- scripts/guestfs.Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kconfigs/Kconfig.libvirt b/kconfigs/Kconfig.libvirt index cba8abf1e24b..74a93f177732 100644 --- a/kconfigs/Kconfig.libvirt +++ b/kconfigs/Kconfig.libvirt @@ -167,7 +167,7 @@ config LIBVIRT_STORAGE_POOL_PATH config KDEVOPS_STORAGE_POOL_PATH string output yaml - default "{{ libvirt_storage_pool_path }}/kdevops" + default "{{ libvirt_storage_pool_path }}/{{ kdevops_storage_pool_user }}" config QEMU_BIN_PATH string diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index bc0176f8f5b4..6019241c8d99 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -15,7 +15,7 @@ if [ "${CONFIG_LIBVIRT_EXTRA_DRIVE_FORMAT_RAW}" = "y" ]; then IMG_FMT="raw" fi STORAGETOPDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}" -STORAGEDIR="${STORAGETOPDIR}/kdevops/guestfs" +STORAGEDIR="${STORAGETOPDIR}/${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..8cf58e4d91c8 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}/${USER}/guestfs" GUESTFSDIR="${TOPDIR}/guestfs" if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index e1cf25d62d04..e0a7b4e5341c 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -104,4 +104,4 @@ destroy_guestfs: PHONY += destroy_guestfs cleancache: - $(Q)rm -f $(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/* + $(Q)rm -f $(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_PATH))/$(USER)/guestfs/base_images/* -- 2.49.0