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 ! $qemu -machine '?' 2>&1 | grep 'pseries' > /dev/null; then 18 echo "$qemu doesn't support pSeries ('-machine pseries'). Exiting." 19 exit 2 20fi 21 22M='-machine pseries' 23M+=",accel=$ACCEL$ACCEL_PROPS" 24 25if [[ "$ACCEL" == "tcg" ]] ; then 26 M+=",cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=off" 27fi 28 29command="$qemu -nodefaults $M -bios $FIRMWARE" 30command+=" -display none -serial stdio -kernel" 31command="$(migration_cmd) $(timeout_cmd) $command" 32 33# powerpc tests currently exit with rtas-poweroff, which exits with 0. 34# run_qemu treats that as a failure exit and returns 1, so we need 35# to fixup the fixup below by parsing the true exit code from the output. 36# The second fixup is also a FIXME, because once we add chr-testdev 37# support for powerpc, we won't need the second fixup. 38run_qemu_status $command "$@" 39