xref: /kvm-unit-tests/s390x/run (revision 553125df6292c069377ad3351a7316dd7a68b8d6)
1#!/usr/bin/env bash
2
3if [ -z "$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
12ACCEL=$(get_qemu_accelerator) ||
13	exit $?
14
15qemu=$(search_qemu_binary) ||
16	exit $?
17
18M='-machine s390-ccw-virtio'
19M+=",accel=$ACCEL"
20command="$qemu -nodefaults -nographic $M"
21command+=" -chardev stdio,id=con0 -device sclpconsole,chardev=con0"
22command+=" -kernel"
23command="$(timeout_cmd) $command"
24
25# We return the exit code via stdout, not via the QEMU return code
26run_qemu_status $command "$@"
27