X-Git-Url: http://git.annexia.org/?p=qemu-sanity-check.git;a=blobdiff_plain;f=qemu-sanity-check.in;h=e1abafd9bd754aedc76c44b1e74fefc2f7318d2a;hp=5bb5b292def5caff5ca63071565bd447cf5f4efd;hb=b1dcf280b829474c8bce6c0143bebc4c463bd0b2;hpb=cd157f07578f35732ac4de40714ad35d84335507 diff --git a/qemu-sanity-check.in b/qemu-sanity-check.in index 5bb5b29..e1abafd 100644 --- a/qemu-sanity-check.in +++ b/qemu-sanity-check.in @@ -1,7 +1,7 @@ #!/bin/bash # -*- shell-script -*- # qemu-sanity-check -# Copyright (C) 2013 Red Hat Inc. +# Copyright (C) 2013-2020 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,6 +27,14 @@ canonical_arch="$(uname -m | sed 's/i[456]86/i386/')" timeout=10m accel=kvm:tcg +# Default machine type depends on arch. You can override this using +# -m|--machine option. +case "$canonical_arch" in + arm*|aarch*) machine=virt ;; + # On non-ARM let qemu pick the default. + *) machine= ;; +esac + # Handle command line parsing. function usage { @@ -36,6 +44,7 @@ function usage { 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 " -m|--machine=machine Set machine type" echo " -q|--qemu=qemu Set location of qemu/KVM binary" echo " -t|--timeout=timeout Set the timeout" echo " -V|--version Display version and exit" @@ -43,11 +52,12 @@ function usage { } TEMP=$(getopt \ - -o i:k:q:t:V \ + -o i:k:m:q:t:V \ --long help \ --long accel: \ --long initrd: \ --long kernel: \ + --long machine: \ --long qemu: \ --long timeout: \ --long version \ @@ -72,6 +82,10 @@ while true; do kernel="$2" shift 2 ;; + -m|--machine) + machine="$2" + shift 2 + ;; -q|--qemu) qemu="$2" shift 2 @@ -140,11 +154,12 @@ test_output="$(mktemp --suff=.out)" declare -a argv i=0 argv[$((i++))]="$qemu" -argv[$((i++))]="-nographic" -argv[$((i++))]="-nodefconfig" +argv[$((i++))]="-display" +argv[$((i++))]="none" +argv[$((i++))]="-no-user-config" argv[$((i++))]="-nodefaults" argv[$((i++))]="-machine" -argv[$((i++))]="accel=$accel" +argv[$((i++))]="$machine${machine:+,}accel=$accel" argv[$((i++))]="-no-reboot" argv[$((i++))]="-serial" argv[$((i++))]="file:$test_output"