Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions kconfigs/Kconfig.libvirt
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ config LIBVIRT_STORAGE_POOL_PATH
default LIBVIRT_STORAGE_POOL_PATH_CUSTOM if LIBVIRT && LIBVIRT_STORAGE_POOL_PATH_CUSTOM_MANUAL
default VIRTUALBOX_STORAGE_POOL_PATH_CUSTOM if VAGRANT_VIRTUALBOX

config KDEVOPS_STORAGE_POOL_PATH
string
output yaml
default "{{ libvirt_storage_pool_path }}/kdevops"

config QEMU_BIN_PATH
string
default QEMU_BIN_PATH_LIBVIRT if LIBVIRT
Expand Down Expand Up @@ -1104,6 +1099,53 @@ config LIBVIRT_STORAGE_POOL_NAME
For instance you may want to use a volume name of "data2" for a path
on a partition on /data2/ or something like that.

choice
prompt "Storage pool user name to use"
default KDEVOPS_STORAGE_POOL_USER_DEFAULT
help
The storage pool user is name of the local user ID that has
access to the libvirt storage pool to be used by kdevops.

When there is only one user running kdevops on a system,
the default setting should work. To enable multiple users
to run kdevops on the same system, select
KDEVOPS_STORAGE_POOL_USER_AUTO.

config KDEVOPS_STORAGE_POOL_USER_DEFAULT
bool "default"
help
The default storage pool user name is always "kdevops".

config KDEVOPS_STORAGE_POOL_USER_AUTO
bool "auto"
help
Kdevops selects the storage pool user name.

config KDEVOPS_STORAGE_POOL_USER_CUSTOM
bool "custom"
help
Set a fixed custom storage pool user name.

endchoice

config KDEVOPS_STORAGE_POOL_USER_CUSTOM_NAME
string "Storage pool user name"
depends on KDEVOPS_STORAGE_POOL_USER_CUSTOM
help
Set the name of the storage pool user.

config KDEVOPS_STORAGE_POOL_USER
string
output yaml
default "kdevops" if KDEVOPS_STORAGE_POOL_USER_DEFAULT
default $(shell, echo $USER) if KDEVOPS_STORAGE_POOL_USER_AUTO
default KDEVOPS_STORAGE_POOL_USER_CUSTOM_NAME if KDEVOPS_STORAGE_POOL_USER_CUSTOM

config KDEVOPS_STORAGE_POOL_PATH
string
output yaml
default "{{ libvirt_storage_pool_path }}/{{ kdevops_storage_pool_user }}"

source "kconfigs/Kconfig.libvirt.zns"
source "kconfigs/Kconfig.libvirt.largeio"
source "kconfigs/Kconfig.libvirt.cxl"
3 changes: 1 addition & 2 deletions scripts/bringup_guestfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_LIBVIRT_STORAGE_POOL_PATH}/${CONFIG_KDEVOPS_STORAGE_POOL_USER}/guestfs"
QEMU_GROUP=$CONFIG_LIBVIRT_QEMU_GROUP
GUESTFSDIR="${TOPDIR}/guestfs"
OS_VERSION=${CONFIG_VIRT_BUILDER_OS_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion scripts/destroy_guestfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}/${CONFIG_KDEVOPS_STORAGE_POOL_USER}/guestfs"
GUESTFSDIR="${TOPDIR}/guestfs"

if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then
Expand Down
3 changes: 1 addition & 2 deletions scripts/guestfs.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export KDEVOPS_PROVISIONED_SSH := $(KDEVOPS_PROVISIONED_SSH_DEFAULT_GUARD)
GUESTFS_ARGS += guestfs_path='$(TOPDIR_PATH)/guestfs'
GUESTFS_ARGS += data_home_dir=/home/kdevops
GUESTFS_ARGS += virtbuilder_os_version=$(CONFIG_VIRT_BUILDER_OS_VERSION)
GUESTFS_ARGS += kdevops_storage_pool_user='$(USER)'

GUESTFS_ARGS += libvirt_provider=True

Expand Down Expand Up @@ -100,4 +99,4 @@ destroy_guestfs:
PHONY += destroy_guestfs

cleancache:
$(Q)rm -f $(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/*
$(Q)rm -f $(CONFIG_LIBVIRT_STORAGE_POOL_PATH)/$(CONFIG_KDEVOPS_STORAGE_POOL_USER)/guestfs/base_images/*
2 changes: 0 additions & 2 deletions scripts/vagrant.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ else
VAGRANT_PRIVATE_BOX_DEPS :=
endif

VAGRANT_ARGS += kdevops_storage_pool_user='$(USER)'

ifeq (y,$(CONFIG_LIBVIRT))
VAGRANT_ARGS += libvirt_provider=True

Expand Down