Commit 1ca22afa authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

test/vhost: update QEMU to spdk-2.12-pre branch



Install the new custom qemu branch in a different location
(/usr/local/qemu/spdk-2.12-pre) so it can coexist with the current qemu
branch.

Change-Id: I6986dcaef804dcefc4e77c83c019ba0f3be8dbd6
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398983


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
parent 7d63026b
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -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 ~

+3 −4
Original line number Diff line number Diff line
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 ))
+4 −3
Original line number Diff line number Diff line
@@ -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"