X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=run-supernested.sh.in;h=879886c1948ca1321da8b80cc59f18334ef16a90;hb=1940a477d823833af53eb231bd21cf4c50e13a58;hp=eac3d9b7f6b76f084e0ae493e87f1eeca2d639f3;hpb=ede28fd8d32f86e72fea2091e77f9c76699aa5c4;p=supernested.git diff --git a/run-supernested.sh.in b/run-supernested.sh.in index eac3d9b..879886c 100644 --- a/run-supernested.sh.in +++ b/run-supernested.sh.in @@ -26,10 +26,11 @@ kernel=kernel initrd=initrd append="panic=1 console=ttyS0 udevtimeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0" smp= +tcg= TEMP=`getopt \ -o '' \ - --longoptions 'help,nested,smp:' \ + --longoptions 'help,nested,smp:,tcg' \ -n run-supernested.sh -- "$@"` if [ $? != 0 ]; then echo "$0: problem parsing the command line arguments" @@ -40,9 +41,10 @@ eval set -- "$TEMP" usage () { echo "$0: Run the supernested appliance." - echo " $0 [--smp=N]" + echo " $0 [--smp=N] [--tcg]" echo "Options:" echo " --smp=N Use N virtual CPUs (at all levels)." + echo " --tcg Use TCG (at all levels) instead of KVM." } while true ; do @@ -58,14 +60,20 @@ while true ; do grep -Eo 'supernested.smp=[[:digit:]]+' /proc/cmdline | grep -Eo '[[:digit:]]+' )" - if [ -n "$smp" ]; then smp="-smp $smp"; fi + tcg= + if grep -q supernested.tcg=1 /proc/cmdline; then + tcg=1 + fi shift ;; --smp) - smp="-smp $2" - append="$append supernested.smp=$2" + smp="$2" shift 2 ;; + --tcg) + tcg=1 + shift + ;; --help) usage exit 0 @@ -106,9 +114,20 @@ level="$( if [ -z "$level" ]; then level=0; fi append="$append supernested.level=$((level+1))" +# Append other parameters to nested command line. +append="$append supernested.smp=$smp supernested.tcg=$tcg" + +extra_args= +if [ -n "$smp" ]; then extra_args="$extra_args -smp $smp"; fi +if [ -n "$tcg" ]; then + extra_args="$extra_args -machine accel=tcg" +else + extra_args="$extra_args -cpu host -machine accel=kvm" +fi + echo "Running" echo " qemu = $qemu" -echo " smp = $smp" +echo " extra_args = $extra_args" echo " memory = $memory" echo " kernel = $kernel" echo " initrd = $initrd" @@ -120,9 +139,7 @@ sync exec \ "$qemu" \ - -cpu host \ - -machine accel=kvm \ - $smp \ + $extra_args \ -display none \ -m $memory \ -no-reboot \