xref: /kvm-unit-tests/s390x/run (revision 484ab8dc95bc5ed500abac75ef4b16e1ea1df7b0)
1#!/usr/bin/env bash
2
3if [ -z "$KUT_STANDALONE" ]; then
4	if [ ! -f config.mak ]; then
5		echo "run ./configure && make first. See ./configure -h"
6		exit 2
7	fi
8	source config.mak
9	source scripts/arch-run.bash
10fi
11
12set_qemu_accelerator || exit $?
13
14qemu=$(search_qemu_binary) ||
15	exit $?
16
17if [ "${1: -7}" = ".pv.bin" ] || [ "${TESTNAME: -3}" = "_PV" ] && [ "$ACCEL" = "tcg" ]; then
18	echo "Protected Virtualization isn't supported under TCG"
19	exit 2
20fi
21
22if [ "${1: -7}" = ".pv.bin" ] || [ "${TESTNAME: -3}" = "_PV" ] && [ "$MIGRATION" = "yes" ]; then
23	echo "Migration isn't supported under Protected Virtualization"
24	exit 2
25fi
26
27M='-machine s390-ccw-virtio'
28M+=",accel=$ACCEL$ACCEL_PROPS"
29command="$qemu -nodefaults -nographic $M"
30command+=" -chardev stdio,id=con0 -device sclpconsole,chardev=con0"
31command+=" -kernel"
32command="$(panic_cmd) $(migration_cmd) $(timeout_cmd) $command"
33
34# We return the exit code via stdout, not via the QEMU return code
35run_qemu_status $command "$@"
36