diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 531eea4b8c..96d5ba2570 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -1,15 +1,12 @@ : ${SPDK_VHOST_VERBOSE=false} -: ${QEMU_PREFIX="/usr/local/qemu/spdk-3.0.0"} : ${VM_IMAGE="$HOME/vhost_vm_image.qcow2"} TEST_DIR=$(readlink -f $rootdir/..) -#Check if qemu exists -if [ ! -d $QEMU_PREFIX ]; then - error "Qemu not installed on this machine." +if ! hash qemu-img qemu-system-x86_64; then + error 'QEMU is not installed on this system. Unable to run vhost tests.' exit 1 fi -echo "Using qemu folder $QEMU_PREFIX" VM_BASE_DIR="$TEST_DIR/vms" @@ -617,7 +614,7 @@ function vm_setup() if [[ "$os_mode" == "backing" ]]; then notice "Creating backing file for OS image file: $os" - if ! $QEMU_PREFIX/bin/qemu-img create -f qcow2 -b $os $vm_dir/os.qcow2; then + if ! qemu-img 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 @@ -650,7 +647,7 @@ function vm_setup() local task_mask=${!qemu_mask_param} notice "TASK MASK: $task_mask" - local cmd="taskset -a -c $task_mask $QEMU_PREFIX/bin/qemu-system-x86_64 ${eol}" + local cmd="taskset -a -c $task_mask qemu-system-x86_64 ${eol}" local vm_socket_offset=$(( 10000 + 100 * vm_num )) local ssh_socket=$(( vm_socket_offset + 0 )) diff --git a/test/vhost/vhost_boot/vhost_boot.sh b/test/vhost/vhost_boot/vhost_boot.sh index 565e4815c8..ac9aaa521a 100755 --- a/test/vhost/vhost_boot/vhost_boot.sh +++ b/test/vhost/vhost_boot/vhost_boot.sh @@ -73,7 +73,7 @@ timing_enter convert_vm_image modprobe nbd trap 'nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0; err_clean "${FUNCNAME}" "${LINENO}"' ERR nbd_start_disks "$(get_vhost_dir)/rpc.sock" $lvb_u /dev/nbd0 -$QEMU_PREFIX/bin/qemu-img convert $os_image -O raw /dev/nbd0 +qemu-img convert $os_image -O raw /dev/nbd0 sync nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0 sleep 1