From b9395621aed15acfe548f127b43dbc277c5136ff Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Thu, 12 Dec 2019 11:36:39 +0100 Subject: [PATCH] test/vhost: restore possibility to use custom Qemu binaries Use env variables to select custom qemu-img and qemu-system-x86_64 binaries. This is needed to test versus latest Qemu versions from Github. If env variable QEMU_BIN is not present then the defaults for test are system-wide installed packages. This partly reverts changes done in patch: 5502294d76cd68a761a6bc0dd6d294e3a896c1fb which removed possibility to run with custom Qemu binaries. Change-Id: I8138a079ba7013dcd97aad95ae2eed6417f5b18c Signed-off-by: Karol Latecki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477776 Reviewed-by: Ben Walker Reviewed-by: Maciej Wawryk Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Community-CI: SPDK CI Jenkins Tested-by: SPDK CI Jenkins --- test/vhost/common.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index cbfd91822..b2bb287ef 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -1,5 +1,7 @@ : ${SPDK_VHOST_VERBOSE=false} : ${VHOST_DIR="$HOME/vhost_test"} +: ${QEMU_BIN="qemu-system-x86_64"} +: ${QEMU_IMG_BIN="qemu-img"} TEST_DIR=$(readlink -f $rootdir/..) VM_DIR=$VHOST_DIR/vms @@ -9,7 +11,7 @@ VM_PASSWORD="root" #TODO: Move vhost_vm_image.qcow2 into VHOST_DIR on test systems. VM_IMAGE=$HOME/vhost_vm_image.qcow2 -if ! hash qemu-img qemu-system-x86_64; then +if ! hash $QEMU_IMG_BIN $QEMU_BIN; then error 'QEMU is not installed on this system. Unable to run vhost tests.' exit 1 fi @@ -615,7 +617,7 @@ function vm_setup() if [[ "$os_mode" == "backing" ]]; then notice "Creating backing file for OS image file: $os" - if ! qemu-img create -f qcow2 -b $os $vm_dir/os.qcow2; then + if ! $QEMU_IMG_BIN create -f qcow2 -b $os $vm_dir/os.qcow2; then error "Failed to create OS backing file in '$vm_dir/os.qcow2' using '$os'" return 1 fi @@ -648,7 +650,7 @@ function vm_setup() local task_mask=${!qemu_mask_param} notice "TASK MASK: $task_mask" - local cmd="taskset -a -c $task_mask qemu-system-x86_64 ${eol}" + local cmd="taskset -a -c $task_mask $QEMU_BIN ${eol}" local vm_socket_offset=$(( 10000 + 100 * vm_num )) local ssh_socket=$(( vm_socket_offset + 0 ))