Add --accel flag to select KVM or software emulation.
[qemu-sanity-check.git] / qemu-sanity-check.in
index 848c62f..5bb5b29 100644 (file)
@@ -25,6 +25,7 @@ arch="$(uname -m)"
 canonical_arch="$(uname -m | sed 's/i[456]86/i386/')"
 
 timeout=10m
+accel=kvm:tcg
 
 # Handle command line parsing.
 
@@ -32,6 +33,7 @@ function usage {
     echo "qemu-sanity-check [options]"
     echo "Options:"
     echo "  --help               Display this help"
+    echo "  --accel=[kvm|tcg]    Force KVM or software emulation"
     echo "  -i|--initrd=initrd   Set location of initramfs"
     echo "  -k|--kernel=vmlinuz  Set location of kernel"
     echo "  -q|--qemu=qemu       Set location of qemu/KVM binary"
@@ -43,6 +45,7 @@ function usage {
 TEMP=$(getopt \
     -o i:k:q:t:V \
     --long help \
+    --long accel: \
     --long initrd: \
     --long kernel: \
     --long qemu: \
@@ -57,6 +60,10 @@ while true; do
         --help)
             usage
             ;;
+        --accel)
+            accel="$2"
+            shift 2
+            ;;
         -i|--initrd)
             initrd="$2"
             shift 2
@@ -137,7 +144,7 @@ argv[$((i++))]="-nographic"
 argv[$((i++))]="-nodefconfig"
 argv[$((i++))]="-nodefaults"
 argv[$((i++))]="-machine"
-argv[$((i++))]="accel=kvm:tcg"
+argv[$((i++))]="accel=$accel"
 argv[$((i++))]="-no-reboot"
 argv[$((i++))]="-serial"
 argv[$((i++))]="file:$test_output"