From b46b0ecf8b9ab2bd9eaac4128f88e93c162895b9 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Wed, 30 Aug 2023 15:50:48 +0200 Subject: [PATCH] tests/vfio: Configure a value for 'hot_plug_vfio' for both vmms This shouldn't be hiding behind only a qemu check, we need this for clh as well. Signed-off-by: Jeremi Piotrowski --- tests/functional/vfio/run.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/functional/vfio/run.sh b/tests/functional/vfio/run.sh index 965329fcd3..635e161c80 100755 --- a/tests/functional/vfio/run.sh +++ b/tests/functional/vfio/run.sh @@ -188,13 +188,18 @@ setup_configuration_file() { if [ -n "$MACHINE_TYPE" ]; then if [ "$HYPERVISOR" = "qemu" ]; then sed -i 's|^machine_type.*|machine_type = "'${MACHINE_TYPE}'"|g' "${kata_config_file}" - # Make sure we have set hot_plug_vfio to a reasonable value - sudo sed -i -e 's|^#hot_plug_vfio =.*$|hot_plug_vfio = "bridge-port"|' -e 's|^hot_plug_vfio = .*$|hot_plug_vfio = "bridge-port"|' "${kata_config_file}" else warn "Variable machine_type only applies to qemu. It will be ignored" fi fi + # Make sure we have set hot_plug_vfio to a reasonable value + if [ "$HYPERVISOR" = "qemu" ]; then + sed -i -e 's|^#*.*hot_plug_vfio.*|hot_plug_vfio = "bridge-port"|' "${kata_config_file}" + elif [ "$HYPERVISOR" = "clh" ]; then + sed -i -e 's|^#*.*hot_plug_vfio.*|hot_plug_vfio = "root-port"|' "${kata_config_file}" + fi + if [ -n "${SANDBOX_CGROUP_ONLY}" ]; then sed -i 's|^sandbox_cgroup_only.*|sandbox_cgroup_only='${SANDBOX_CGROUP_ONLY}'|g' "${kata_config_file}" fi