X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=run-supernested.sh.in;h=7b2752e1d9c61b34c4a01cf62b0d5849e710cb56;hb=4c4d5d53ffd80c2f7f5b3812d0cbf4615854bcdc;hp=51d84da122b6f4233baa4c10435914809f8b0de7;hpb=2f639f7646798e035e2f04b361f311e462bb28d6;p=supernested.git diff --git a/run-supernested.sh.in b/run-supernested.sh.in index 51d84da..7b2752e 100644 --- a/run-supernested.sh.in +++ b/run-supernested.sh.in @@ -24,11 +24,13 @@ image="supernested-@VERSION@-@DISTRO@.qcow2" format=qcow2 kernel=kernel initrd=initrd -append="panic=1 console=ttyS0 udevtimeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0" +append="panic=1 console=ttyS0 udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0" +smp= +tcg= TEMP=`getopt \ -o '' \ - --longoptions 'help,nested' \ + --longoptions 'help,nested,smp:,tcg' \ -n run-supernested.sh -- "$@"` if [ $? != 0 ]; then echo "$0: problem parsing the command line arguments" @@ -36,6 +38,15 @@ if [ $? != 0 ]; then fi eval set -- "$TEMP" +usage () +{ + echo "$0: Run the supernested appliance." + 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 case "$1" in --nested) @@ -45,11 +56,27 @@ while true ; do format=raw kernel=/kernel initrd=/initrd + smp="$( + grep -Eo 'supernested.smp=[[:digit:]]+' /proc/cmdline | + grep -Eo '[[:digit:]]+' + )" + tcg= + if grep -q supernested.tcg=1 /proc/cmdline; then + tcg=1 + fi shift ;; + --smp) + smp="$2" + shift 2 + ;; + --tcg) + tcg=1 + shift + ;; --help) - echo "$0: read the README file for information about this script" - exit 1 + usage + exit 0 ;; --) shift @@ -87,8 +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 " extra_args = $extra_args" echo " memory = $memory" echo " kernel = $kernel" echo " initrd = $initrd" @@ -100,8 +139,7 @@ sync exec \ "$qemu" \ - -cpu host \ - -machine accel=kvm \ + $extra_args \ -display none \ -m $memory \ -no-reboot \