1#!/usr/bin/env bash 2 3[ -z "$STANDALONE" ] && source scripts/arch-run.bash 4 5qemu=$(search_qemu_binary) 6 7if ! ${qemu} -device '?' 2>&1 | grep -F -e \"testdev\" -e \"pc-testdev\" > /dev/null; 8then 9 echo "No Qemu test device support found" 10 exit 2 11fi 12 13if 14 ${qemu} -device '?' 2>&1 | grep -F "pci-testdev" > /dev/null; 15then 16 pci_testdev="-device pci-testdev" 17else 18 pci_testdev="" 19fi 20 21if 22 ${qemu} -device '?' 2>&1 | grep -F "pc-testdev" > /dev/null; 23then 24 pc_testdev="-device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4" 25else 26 pc_testdev="-device testdev,chardev=testlog -chardev file,id=testlog,path=msr.out" 27fi 28 29command="${qemu} -nodefaults -enable-kvm $pc_testdev -vnc none -serial stdio $pci_testdev $hyperv_testdev" 30[ -f "$ENV" ] && command+=" -initrd $ENV" 31command+=" -kernel" 32command="$(timeout_cmd) $command" 33echo ${command} "$@" 34 35run_qemu ${command} "$@" 36