git.annexia.org
/
supernested.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
63bd4e9
)
Fix the --smp, --tcg options properly this time.
author
Richard W.M. Jones
<rjones@redhat.com>
Thu, 3 Jul 2014 16:31:36 +0000
(17:31 +0100)
committer
Richard W.M. Jones
<rjones@redhat.com>
Thu, 3 Jul 2014 16:31:36 +0000
(17:31 +0100)
run-supernested.sh.in
patch
|
blob
|
history
diff --git
a/run-supernested.sh.in
b/run-supernested.sh.in
index
7e63ceb
..
879886c
100644
(file)
--- a/
run-supernested.sh.in
+++ b/
run-supernested.sh.in
@@
-26,8
+26,7
@@
kernel=kernel
initrd=initrd
append="panic=1 console=ttyS0 udevtimeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0"
smp=
initrd=initrd
append="panic=1 console=ttyS0 udevtimeout=6000 no_timer_check printk.time=1 root=/dev/sda selinux=0"
smp=
-accel=kvm
-cpu="-cpu host"
+tcg=
TEMP=`getopt \
-o '' \
TEMP=`getopt \
-o '' \
@@
-61,27
+60,18
@@
while true ; do
grep -Eo 'supernested.smp=[[:digit:]]+' /proc/cmdline |
grep -Eo '[[:digit:]]+'
)"
grep -Eo 'supernested.smp=[[:digit:]]+' /proc/cmdline |
grep -Eo '[[:digit:]]+'
)"
- if [ -n "$smp" ]; then smp="-smp $smp"; fi
- accel="$(
- grep -Eo 'supernested.accel=tcg' /proc/cmdline
- )"
- if [ -n "$accel" ]; then
- accel=tcg
- cpu=
- else
- accel=kvm
+ tcg=
+ if grep -q supernested.tcg=1 /proc/cmdline; then
+ tcg=1
fi
shift
;;
--smp)
fi
shift
;;
--smp)
- smp="-smp $2"
- append="$append supernested.smp=$2"
+ smp="$2"
shift 2
;;
--tcg)
shift 2
;;
--tcg)
- accel=tcg
- cpu=
- append="$append supernested.accel=tcg"
+ tcg=1
shift
;;
--help)
shift
;;
--help)
@@
-124,11
+114,20
@@
level="$(
if [ -z "$level" ]; then level=0; fi
append="$append supernested.level=$((level+1))"
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 "Running"
echo " qemu = $qemu"
-echo " cpu = $cmp"
-echo " smp = $smp"
-echo " accel = $accel"
+echo " extra_args = $extra_args"
echo " memory = $memory"
echo " kernel = $kernel"
echo " initrd = $initrd"
echo " memory = $memory"
echo " kernel = $kernel"
echo " initrd = $initrd"
@@
-140,9
+139,7
@@
sync
exec \
"$qemu" \
exec \
"$qemu" \
- $cpu \
- $smp \
- -machine accel=$accel \
+ $extra_args \
-display none \
-m $memory \
-no-reboot \
-display none \
-m $memory \
-no-reboot \