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 C4F7027F758 for ; Mon, 14 Apr 2025 17:05:51 +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=1744650351; cv=none; b=b5oZKqvY2g/8dgMgEU49H2HxUuhS29nn+NbYba2aiaiKJPQSjCugJ3Q027VM4oVxTQzRTQIdADFIEwab8XlrF2x3+KZ54l871Ar4TUdwxOasxKJgVuFmBxoibev9XMa1jAv3b/UT4UAShakQKrYW/RbhiCijMujPq9awBv/8hMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744650351; c=relaxed/simple; bh=gWb9yS285//RR4Lj84d7/Y5nmraax0eb5Pdf5ksUoR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HeHNG8WmD1GFuBOtJjkBbvNC0ZHJ8tSquVenzeyAzNdHVobhe+7bQiqxxRy4oSL9e2JaY1ZaHbdJNGJ+ZdkMGqocsf4O+fT7TBXxg9GuN2C2NsEleL+4AZXLcCJksFIKMh/foUjsA42A4NZIiBCWQrG+lQhmW5cthRUKsbN+/AA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F/X2K/KM; 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="F/X2K/KM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F371EC4CEED; Mon, 14 Apr 2025 17:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744650351; bh=gWb9yS285//RR4Lj84d7/Y5nmraax0eb5Pdf5ksUoR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/X2K/KMGNtjaoOEn7JDhdTAtuIDA173hUs36tRGuBNjRuoHzY2xw9R2rOGIPXS3J ZTTfGTbAdIT+IMIi5BDirztqTMr3vP1H6Mxy0rebSYwDyW2uvoCOsF+5r/dO6aZEeN Z+MONAWBNl+fYVWG+3/4oxZOUbPCHqpNvSdAiSDGtgyuvb9BJgzQzkQezZn83QEIkn 8bfXlNgUJxRK58sAlOmFnKsI21Y+RhAx06m+U8/Pt7emVkyGhP4/XCddk1APESZ7ru huFhKEE0l/A7mT6Ho/Cy0Igz+lc/WcdZgtbi1cFmiCLCO+/8kzwT39OoVofkxCmiQK /2zoTCLEdK/dQ== From: cel@kernel.org To: Cc: Chuck Lever Subject: [PATCH v2 4/4] guestfs: Per-user storage pools Date: Mon, 14 Apr 2025 13:05:46 -0400 Message-ID: <20250414170546.1995982-5-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250414170546.1995982-1-cel@kernel.org> References: <20250414170546.1995982-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 | 3 +-- scripts/destroy_guestfs.sh | 2 +- scripts/guestfs.Makefile | 2 +- 4 files changed, 4 insertions(+), 5 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..ea2ff5ee00a5 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_KDEVOPS_STORAGE_POOL_PATH}/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..5e307429f20a 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_KDEVOPS_STORAGE_POOL_PATH}/guestfs" GUESTFSDIR="${TOPDIR}/guestfs" if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index 3dad6a14f0c5..3393fba3d520 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_KDEVOPS_STORAGE_POOL_PATH}/guestfs"))/guestfs/base_images/* -- 2.49.0