Commit 3124e715 authored by Michal Berger's avatar Michal Berger Committed by Jim Harris
Browse files

pkgdep/git: Add optional prefix to qemu dirs



This is done in order to distinguish between different flavors more
easily.

Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: I9740677c878a8e6ad5abb3e2b5c22b9d41d59fc6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7117


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 18ee5d7b
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -258,15 +258,22 @@ function install_flamegraph() {
function _install_qemu() {
	local repo=$1
	local branch=$2
	local prefix=${3:-}

	mkdir -p "$GIT_REPOS/qemu"
	if [[ ! -d $GIT_REPOS/qemu/$branch ]]; then
		git clone "$repo" -b "$branch" "$GIT_REPOS/qemu/$branch"

	local repo_dir=$GIT_REPOS/qemu/$branch
	if [[ -n $prefix ]]; then
		repo_dir=$GIT_REPOS/qemu/$prefix-$branch
	fi

	if [[ ! -d $repo_dir ]]; then
		git clone "$repo" -b "$branch" "$repo_dir"
	else
		echo "qemu already checked out. Skipping"
	fi

	declare -a opt_params=("--prefix=/usr/local/qemu/$branch")
	declare -a opt_params=("--prefix=/usr/local/qemu/${repo_dir##*/}")
	declare -a extra_cflags=()

	opt_params+=("--disable-docs")
@@ -288,10 +295,10 @@ function _install_qemu() {
	opt_params+=("--extra-cflags=${extra_cflags[*]}")

	# The qemu configure script places several output files in the CWD.
	(cd "$GIT_REPOS/qemu/$branch" && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa)
	(cd "$repo_dir" && ./configure "${opt_params[@]}" --target-list="x86_64-softmmu" --enable-kvm --enable-linux-aio --enable-numa)

	make -C "$GIT_REPOS/qemu/$branch" -j${jobs}
	sudo make -C "$GIT_REPOS/qemu/$branch" install
	make -C "$repo_dir" -j${jobs}
	sudo make -C "$repo_dir" install
}

function install_qemu() {
@@ -309,9 +316,10 @@ function install_qemu() {
	SPDK_QEMU_BRANCH=spdk-5.0.0
	VFIO_QEMU_BRANCH=vfio-user-v0.6
	VANILLA_QEMU_BRANCH=v5.1.0

	_install_qemu $GIT_REPO_QEMU_SPDK $SPDK_QEMU_BRANCH
	_install_qemu $GIT_REPO_QEMU_VFIO $VFIO_QEMU_BRANCH
	_install_qemu "$GIT_REPO_QEMU" "$VANILLA_QEMU_BRANCH"
	_install_qemu "$GIT_REPO_QEMU" "$VANILLA_QEMU_BRANCH" vanilla
}

function install_nvmecli() {