@@ -1,5 +1,10 @@
if GUESTFS
+config STORAGE_POOL_PATH
+ string
+ output yaml
+ default LIBVIRT_STORAGE_POOL_PATH
+
config GUESTFS_HAS_CUSTOM_RAW_IMAGE
bool
@@ -155,13 +155,20 @@ config LIBVIRT_QEMU_GROUP
default "qemu" if !DISTRO_DEBIAN && !DISTRO_UBUNTU
default "libvirt-qemu" if DISTRO_DEBIAN || DISTRO_UBUNTU
-config KDEVOPS_STORAGE_POOL_PATH
+
+config LIBVIRT_STORAGE_POOL_PATH
string
+ output yaml
default LIBVIRT_STORAGE_POOL_PATH_AUTO if LIBVIRT && !LIBVIRT_STORAGE_POOL_PATH_CUSTOM_MANUAL
default LIBVIRT_STORAGE_POOL_PATH_AUTO if LIBVIRT && LIBVIRT_STORAGE_POOL_PATH_CUSTOM_CWD
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
@@ -1052,6 +1059,7 @@ endif
config LIBVIRT_STORAGE_POOL_CREATE
bool "Should we build a custom storage pool for you?"
+ output yaml
default n if !LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED
default $(shell, ./scripts/get_libvirsh_pool_enabled.sh) if LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED
help
@@ -1063,6 +1071,7 @@ config LIBVIRT_STORAGE_POOL_CREATE
config LIBVIRT_STORAGE_POOL_NAME
string "Libvirt storage pool name"
+ output yaml
depends on LIBVIRT_STORAGE_POOL_CREATE
default "default" if !LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED
default $(shell, ./scripts/get_libvirsh_pool_name.sh) if LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED
@@ -14,7 +14,7 @@ IMG_FMT="qcow2"
if [ "${CONFIG_LIBVIRT_EXTRA_DRIVE_FORMAT_RAW}" = "y" ]; then
IMG_FMT="raw"
fi
-STORAGETOPDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}"
+STORAGETOPDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}"
STORAGEDIR="${STORAGETOPDIR}/kdevops/guestfs"
QEMU_GROUP=$CONFIG_LIBVIRT_QEMU_GROUP
GUESTFSDIR="${TOPDIR}/guestfs"
@@ -55,7 +55,7 @@ vagrant_check_dups()
# instances *and* we know one does not exist in another
# directory for this user.
- kdevops_pool_path="$CONFIG_KDEVOPS_STORAGE_POOL_PATH"
+ kdevops_pool_path="$CONFIG_LIBVIRT_STORAGE_POOL_PATH"
# For libvirt we can do one more global sanity check
if [[ "$CONFIG_LIBVIRT" == "y" ]]; then
possible_image="${kdevops_pool_path}/vagrant_${instance}.img"
@@ -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_LIBVIRT_STORAGE_POOL_PATH}/kdevops/guestfs"
GUESTFSDIR="${TOPDIR}/guestfs"
if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then
@@ -18,7 +18,7 @@ rm -rf .vagrant
# doing so we don't check for global dups or anything like that.
UNINIT_CURRENT_INSTANCES=$(vagrant status --machine-readable | grep ",state," | grep not_created | awk -F "," '{print $2}')
for i in $UNINIT_CURRENT_INSTANCES; do
- UNINIT_INSTANCE_SPARE_DRIVE_DIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/kdevops/$i"
+ UNINIT_INSTANCE_SPARE_DRIVE_DIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/kdevops/$i"
if [[ -d $UNINIT_INSTANCE_SPARE_DRIVE_DIR ]]; then
echo "Found unitialized (possibly old) instance spare drive directory, removing it ... $i"
rm -rf $UNINIT_INSTANCE_SPARE_DRIVE_DIR
@@ -42,12 +42,6 @@ GEN_NODES_EXTRA_ARGS += libvirt_session_management_network_device='$(subst ",,$(
GEN_NODES_EXTRA_ARGS += libvirt_session_public_network_dev='$(subst ",,$(CONFIG_LIBVIRT_SESSION_PUBLIC_NETWORK_DEV))'
endif
-ifeq (y,$(CONFIG_LIBVIRT_STORAGE_POOL_CREATE))
-GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_create='True'
-GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_name='$(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_NAME))'
-GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_path='$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))'
-endif
-
GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_MODE))'
GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_cache_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_CACHE_MODE))'
@@ -18,11 +18,6 @@ QEMU_GROUP:=$(subst ",,$(CONFIG_LIBVIRT_QEMU_GROUP))
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
-GUESTFS_ARGS += storage_pool_path=$(STORAGE_POOL_PATH)
-GUESTFS_ARGS += kdevops_storage_pool_path=$(KDEVOPS_STORAGE_POOL_PATH)
-
9P_HOST_CLONE :=
ifeq (y,$(CONFIG_BOOTLINUX_9P))
9P_HOST_CLONE := 9p_linux_clone
@@ -109,4 +104,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_LIBVIRT_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/*
@@ -37,7 +37,7 @@ if [[ "$CONFIG_LIBVIRT" != "y" ]]; then
fi
if [[ $# -eq 0 ]]; then
- KDEVOPS_POOL_PATH="$CONFIG_KDEVOPS_STORAGE_POOL_PATH"
+ KDEVOPS_POOL_PATH="$CONFIG_LIBVIRT_STORAGE_POOL_PATH"
elif [[ $# -eq 1 ]]; then
if [[ "$1" == "--help" ]]; then
echo "Usage: $0"
@@ -44,11 +44,6 @@ ifeq (y,$(CONFIG_VAGRANT_VIRTUALBOX))
VAGRANT_ARGS += virtualbox_provider=True
endif
-STORAGE_POOL_PATH:=$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))
-KDEVOPS_STORAGE_POOL_PATH:=$(STORAGE_POOL_PATH)/kdevops
-VAGRANT_ARGS += storage_pool_path=$(STORAGE_POOL_PATH)
-VAGRANT_ARGS += kdevops_storage_pool_path=$(KDEVOPS_STORAGE_POOL_PATH)
-
VAGRANT_9P_HOST_CLONE :=
ifeq (y,$(CONFIG_BOOTLINUX_9P))
VAGRANT_9P_HOST_CLONE := vagrant_9p_linux_clone
Turns out we define CONFIG_KDEVOPS_STORAGE_POOL_PATH only to make it be the same as generic CONFIG_LIBVIRT_STORAGE_POOL_PATH only later to then use the old GUESTFS_ARGS or VAGRANT_ARGS to define the yaml version with a postfix "kdevops". Fix all this mess by using yaml output and cleaing its use up. This does not fix any bugs, it just make things consistent. And so where you saw CONFIG_KDEVOPS_STORAGE_POOL_PATH we now just use the generic version CONFIG_LIBVIRT_STORAGE_POOL_PATH. The kconfig symbol CONFIG_KDEVOPS_STORAGE_POOL_PATH gets promoted to be what we expect it, that is: "{{ libvirt_storage_pool_path }}/kdevops" This also ensure we will barf as we want to promote using ansible for this anyway and do away with all of the CONFIG_KDEVOPS_STORAGE_POOL_PATH uses in shell scripts. This kills all use of CONFIG_KDEVOPS_STORAGE_POOL_PATH from shell scripts too then. The motivation for all this is to slowly trim away the large error-prone script scripts/bringup_guestfs.sh into ansible. This is just a small step towards making that easier. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> --- kconfigs/Kconfig.guestfs | 5 +++++ kconfigs/Kconfig.libvirt | 11 ++++++++++- scripts/bringup_guestfs.sh | 2 +- scripts/bringup_vagrant.sh | 2 +- scripts/destroy_guestfs.sh | 2 +- scripts/destroy_vagrant.sh | 2 +- scripts/gen-nodes.Makefile | 6 ------ scripts/guestfs.Makefile | 7 +------ scripts/prune_stale_vagrant.sh | 2 +- scripts/vagrant.Makefile | 5 ----- 10 files changed, 21 insertions(+), 23 deletions(-)