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 6E70627EC78 for ; Wed, 23 Apr 2025 14:20:12 +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=1745418012; cv=none; b=erNPPrB904hqDyPP03WfpDd1PPsQVnnG6O3YZz9nbG9RtkxH5YurecNySSNKjNiSbUOXIIawYFvmrOmjssBulK0RbtW/6U2DsvF7XIfxKp7KH8c9YKBJ1gslvs4v9lzLI8oZCwSRlMlZFqmmTOy0hc7fHFaeWUZxUSjKS8oCjRA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745418012; c=relaxed/simple; bh=ZGaPEgOUONRDNGLZDGOa9wmnfkSxLjOgEulmASSh4BA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t3YBnRZexG93/rWzT0l0TgNmVN/XPa5HoJT+0oUOGCNwjz11t0cfTD2HI8+pqBdxEzz4AqnTYAM9r8+4X4VBohu/h3E6fZdCuj413+V3+ZaHVNxlUlXdhg9BqTF3TOg4aSTAf1qM/yvevcNNguWH52QXjvuVK2uJXNDCweqqnaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hsoWQvwT; 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="hsoWQvwT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0DE2C4CEE8; Wed, 23 Apr 2025 14:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745418012; bh=ZGaPEgOUONRDNGLZDGOa9wmnfkSxLjOgEulmASSh4BA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hsoWQvwTpasSmhdryGnIrey9dtIC2z0c3az183FZCBETdrhbXdIy4BUwBPsM24mZ7 8XhERHW0IPYqOtEv5q5AQHu9xjPzkxzLp+jcyX1jt/YaL2z6zURLlurDS+ezQYV5po lJCKcJqPcPBf6EAZ1f/pzCFIktBSLV0S0zt/bXEuZdk0qhtZOsGZ2IDHbFh6n9T+8W HF62WvvEqEtrG7NTHlx/VvQY/RX2SkukzBUEA1H/Ua/R4KIA+Q8oD5SIOQz7oOHtx6 USst+WoIch1Zl2RVdVTRsklhrChkfy4mZOtgepZ58b7x/NihunRNzh1fuX/qr48IPz 5QMIA26Q+GNRA== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v3 1/1] guestfs: Per-user storage pools Date: Wed, 23 Apr 2025 10:20:09 -0400 Message-ID: <20250423142009.685177-2-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250423142009.685177-1-cel@kernel.org> References: <20250423142009.685177-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 94e0437192be..7997002826dd 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 3dad6a14f0c5..03bd582ff1f2 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -100,4 +100,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