From 253c1785e5a923c4db67e671f1e44191264dce6c Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Thu, 11 Mar 2021 14:09:26 +0100 Subject: [PATCH] test/common: install vfio-user-pci capable Qemu fork Fork needed to run Vhost tests using vfio-user. Signed-off-by: Karol Latecki Change-Id: Iedfa85083e51c08592c9f512c6650415b49deda8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6846 Tested-by: SPDK CI Jenkins Reviewed-by: Monica Kenguva Reviewed-by: Maciej Wawryk Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Michal Berger --- test/common/config/pkgdep/git | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index b3cb2a128..34be9669b 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -249,21 +249,18 @@ function install_flamegraph() { fi } -function install_qemu() { - # Two versions of QEMU are used in the tests. - # Stock QEMU is used for vhost. A special fork - # is used to test OCSSDs. Install both. +function _install_qemu() { + local repo=$1 + local branch=$2 - # Forked QEMU - SPDK_QEMU_BRANCH=spdk-5.0.0 mkdir -p "$GIT_REPOS/qemu" - if [[ ! -d $GIT_REPOS/qemu/$SPDK_QEMU_BRANCH ]]; then - git clone "${GIT_REPO_QEMU}" -b "$SPDK_QEMU_BRANCH" "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH" + if [[ ! -d $GIT_REPOS/qemu/$branch ]]; then + git clone "$repo" -b "$branch" "$GIT_REPOS/qemu/$branch" else echo "qemu already checked out. Skipping" fi - declare -a opt_params=("--prefix=/usr/local/qemu/$SPDK_QEMU_BRANCH") + declare -a opt_params=("--prefix=/usr/local/qemu/$branch") declare -a extra_cflags=() opt_params+=("--disable-docs") @@ -284,15 +281,29 @@ function install_qemu() { fi opt_params+=("--extra-cflags=${extra_cflags[*]}") - sed -i s@git://git.qemu.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH/.gitmodules" - sed -i s@git://git.qemu.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH/.git/config" - sed -i s@git://git.qemu-project.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH/.gitmodules" - sed -i s@git://git.qemu-project.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH/.git/config" + sed -i s@git://git.qemu.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$branch/.gitmodules" + sed -i s@git://git.qemu.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$branch/.git/config" + sed -i s@git://git.qemu-project.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$branch/.gitmodules" + sed -i s@git://git.qemu-project.org/@https://github.com/qemu/@g "$GIT_REPOS/qemu/$branch/.git/config" # The qemu configure script places several output files in the CWD. - (cd "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH" && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa) + (cd "$GIT_REPOS/qemu/$branch" && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa) - make -C "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH" -j${jobs} - sudo make -C "$GIT_REPOS/qemu/$SPDK_QEMU_BRANCH" install + make -C "$GIT_REPOS/qemu/$branch" -j${jobs} + sudo make -C "$GIT_REPOS/qemu/$branch" install +} + +function install_qemu() { + # Three versions of QEMU are used in the tests. + # Stock QEMU is used for vhost. + # A special fork is used to test OCSSDs. + # Third is for libvfio-user tests. + # Install all. + + # Forked QEMUs + SPDK_QEMU_BRANCH=spdk-5.0.0 + VFIO_QEMU_BRANCH=vfio-user-v0.6 + _install_qemu $GIT_REPO_QEMU $SPDK_QEMU_BRANCH + _install_qemu $GIT_REPO_QEMU_VFIO $VFIO_QEMU_BRANCH } function install_nvmecli() { @@ -545,6 +556,8 @@ export GIT_REPO_FIO export GIT_REPO_FLAMEGRAPH : ${GIT_REPO_QEMU=https://github.com/spdk/qemu} export GIT_REPO_QEMU +: ${GIT_REPO_QEMU_VFIO=https://github.com/tmakatos/qemu} +export GIT_REPO_QEMU_VFIO : ${GIT_REPO_LIBISCSI=https://github.com/sahlberg/libiscsi} export GIT_REPO_LIBISCSI : ${GIT_REPO_INTEL_IPSEC_MB=https://github.com/spdk/intel-ipsec-mb.git}