Commit 5502294d authored by Ben Walker's avatar Ben Walker
Browse files

test/vhost: Use whichever qemu is installed on the system



Don't use a fork of QEMU that's in a specific directory.

On the test systems, we can install the forked QEMU as
the default QEMU and put the binaries in PATH so that
it works.

Change-Id: I637d70452901c85606eb5eeb2bf6c67ae98cd92f
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458597


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 48a6e736
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
: ${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 ))
+1 −1
Original line number Diff line number Diff line
@@ -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