diff --git a/test/config/vm_setup.sh b/test/config/vm_setup.sh index 48e6344b1..fc7618569 100755 --- a/test/config/vm_setup.sh +++ b/test/config/vm_setup.sh @@ -62,6 +62,7 @@ sudo dnf install -y lcov sudo dnf install -y libuuid-devel sudo dnf install -y elfutils-libelf-devel sudo dnf install -y flex +sudo dnf install -y bison cd ~ @@ -137,15 +138,16 @@ git clone https://github.com/brendangregg/FlameGraph.git mkdir -p /usr/local sudo mv FlameGraph /usr/local/FlameGraph - -# The SPDK branch of Qemu contains some extra functionality needed by SPDK. However, that branch is not currently -# compatible with GCC 7. Some of the SPDK changes are currently out for review on Qemu's main branch. Until those -# changes are merged, this specific review provides support for both spdk and GCC 7. -mkdir -p vhost -cd vhost -git clone https://review.gerrithub.io/spdk/qemu +SPDK_QEMU_BRANCH=spdk-2.12-pre +mkdir -p qemu cd qemu -./configure --prefix=/home/sys_sgsw/spdk_repo/root --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa +git clone https://github.com/spdk/qemu -b "$SPDK_QEMU_BRANCH" "$SPDK_QEMU_BRANCH" +cd "$SPDK_QEMU_BRANCH" +if hash tsocks &> /dev/null; then + git_param="--with-git='tsocks git'" +fi +./configure "$git_param" --prefix=/usr/local/qemu/$SPDK_QEMU_BRANCH --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa +make sudo make install cd ~ diff --git a/test/vhost/common/common.sh b/test/vhost/common/common.sh index 6a10b18c6..2d6be2b52 100644 --- a/test/vhost/common/common.sh +++ b/test/vhost/common/common.sh @@ -1,6 +1,7 @@ set -e : ${SPDK_VHOST_VERBOSE=false} +: ${QEMU_PREFIX="/usr/local/qemu/spdk-2.12-pre"} BASE_DIR=$(readlink -f $(dirname $0)) @@ -66,8 +67,6 @@ echo "Using SSH key file $SPDK_VHOST_SSH_KEY_FILE" VM_BASE_DIR="$TEST_DIR/vms" -INSTALL_DIR="$TEST_DIR/root" - mkdir -p $TEST_DIR # @@ -501,7 +500,7 @@ function vm_setup() if [[ "$os_mode" == "backing" ]]; then notice "Creating backing file for OS image file: $os" - if ! $INSTALL_DIR/bin/qemu-img create -f qcow2 -b $os $vm_dir/os.qcow2; then + if ! $QEMU_PREFIX/bin/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 @@ -534,7 +533,7 @@ function vm_setup() local task_mask=${!qemu_mask_param} notice "TASK MASK: $task_mask" - local cmd="taskset -a $task_mask $INSTALL_DIR/bin/qemu-system-x86_64 ${eol}" + local cmd="taskset -a $task_mask $QEMU_PREFIX/bin/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/integrity/integrity_start.sh b/test/vhost/integrity/integrity_start.sh index 2ea762352..fec79da74 100755 --- a/test/vhost/integrity/integrity_start.sh +++ b/test/vhost/integrity/integrity_start.sh @@ -2,10 +2,11 @@ set -xe +: ${QEMU_PREFIX="/usr/local/qemu/spdk-2.12-pre"} + basedir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $basedir/../../..) testdir=$(readlink -f $rootdir/..) -qemu_install_dir="$testdir/root" MAKE="make -j$(( $(nproc) * 2 ))" rpc_py="python $rootdir/scripts/rpc.py " @@ -47,7 +48,7 @@ fi # Check if Qemu binary is present if [[ -z $VM_QEMU ]]; then - VM_QEMU="$qemu_install_dir/bin/qemu-system-x86_64" + VM_QEMU="$QEMU_PREFIX/bin/qemu-system-x86_64" fi if [[ ! -x $VM_QEMU ]]; then @@ -55,7 +56,7 @@ if [[ ! -x $VM_QEMU ]]; then fi if [[ -z $QEMU_IMG ]]; then - QEMU_IMG="$qemu_install_dir/bin/qemu-img" + QEMU_IMG="$QEMU_PREFIX/bin/qemu-img" fi echo "Running test with filesystem: $VM_FS"