summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2016-06-22 10:54:38 +0300
committerRiku Voipio <riku.voipio@linaro.org>2016-06-22 14:39:00 +0300
commit5d09e9c8d62c8876f1a33fe7198df555d0dd52bc (patch)
treee3c35142f57c3ab65f31f5d711032574657120a2 /common
parentc36a47a28b1ccb65d89ca243edd26b8da8a2d3de (diff)
kvm-cloud improvements
- Make guest CPU count a parameter - Make guest RAM a parameter - KVM can't migrate from A53 to A57, so tie juno to A53 cluster - remove the $cloudimage parameter since we always use same filename Change-Id: I0bfe12c52e5ec2590f664f9c34292d6512df45a9 Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/kvm-cloud/start-kvm.sh48
1 files changed, 28 insertions, 20 deletions
diff --git a/common/scripts/kvm-cloud/start-kvm.sh b/common/scripts/kvm-cloud/start-kvm.sh
index ff3922b..d166771 100755
--- a/common/scripts/kvm-cloud/start-kvm.sh
+++ b/common/scripts/kvm-cloud/start-kvm.sh
@@ -41,7 +41,7 @@ download_file()
>&2 echo "Error, url for $_outvar not set!"
exit 2
fi
- if ! curl --retry 3 -SOL -# $url
+ if ! curl --retry 3 -SsOL $url
then
>&2 echo "Error downloading $url for $_outvar"
exit 3
@@ -53,15 +53,15 @@ download_file()
start_qemu_x86_64_aarch64()
{
image=$1
- configimage=$2
download_file efi $GUEST_FIRMWARE
- qemu-system-aarch64 -smp 2 -m 1024 -cpu cortex-a57 -M virt \
+ set -x
+ qemu-system-aarch64 -smp $GUEST_CORES -m ${GUEST_RAM} -cpu cortex-a57 -M virt \
-bios $efi \
-device virtio-blk-device,drive=image \
-drive if=none,id=image,file=$image \
-device virtio-blk-device,drive=cloud \
- -drive if=none,id=cloud,file=$configimage \
+ -drive if=none,id=cloud,file=cloud.img \
-device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=no,downscript=no,ifname=tap0 \
-daemonize -display vnc=none \
-serial file:qemu_aarch64.txt
@@ -70,15 +70,15 @@ start_qemu_x86_64_aarch64()
start_qemu_aarch64_aarch64()
{
image=$1
- configimage=$2
download_file efi $GUEST_FIRMWARE
- qemu-system-aarch64 -smp 2 -m 1024 -cpu host -M virt \
+ set -x
+ qemu-system-aarch64 -smp $GUEST_CORES -m ${GUEST_RAM} -cpu host -M virt \
-bios $efi \
-device virtio-blk-device,drive=image \
-drive if=none,id=image,file=$image \
-device virtio-blk-device,drive=cloud \
- -drive if=none,id=cloud,file=$configimage \
+ -drive if=none,id=cloud,file=cloud.img \
-device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=no,downscript=no,ifname=tap0 \
-daemonize -enable-kvm -display vnc=none \
-serial file:kvm-aarch64_aarch64.txt
@@ -87,16 +87,16 @@ start_qemu_aarch64_aarch64()
start_qemu_x86_64_armv7l()
{
image=$1
- configimage=$2
download_file kernel $GUEST_KERNEL
- qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M virt \
+ set -x
+ qemu-system-arm -smp $GUEST_CORES -m ${GUEST_RAM} -cpu cortex-a15 -M virt \
-kernel $kernel \
- -append 'root=/dev/vdb1 rw rootwait mem=1024M console=ttyAMA0,38400n8' \
+ -append "root=/dev/vdb1 rw rootwait mem=${GUEST_RAM}M console=ttyAMA0,38400n8" \
-device virtio-blk-device,drive=image \
-drive if=none,id=image,file=$image \
-device virtio-blk-device,drive=cloud \
- -drive if=none,id=cloud,file=$configimage \
+ -drive if=none,id=cloud,file=cloud.img \
-device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=no,downscript=no,ifname=tap0 \
-daemonize -display vnc=none \
-serial file:qemu_armv7l.txt
@@ -105,16 +105,16 @@ start_qemu_x86_64_armv7l()
start_qemu_aarch64_armv7l()
{
image=$1
- configimage=$2
download_file kernel $GUEST_KERNEL
- qemu-system-aarch64 -smp 2 -m 1024 -cpu host,aarch64=off -M virt \
+ set -x
+ qemu-system-aarch64 -smp $GUEST_CORES -m ${GUEST_RAM} -cpu host,aarch64=off -M virt \
-kernel $kernel \
- -append 'root=/dev/vdb1 rw rootwait mem=1024M console=ttyAMA0,38400n8' \
+ -append "root=/dev/vdb1 rw rootwait mem=${GUEST_RAM}M console=ttyAMA0,38400n8" \
-device virtio-blk-device,drive=image \
-drive if=none,id=image,file=$image \
-device virtio-blk-device,drive=cloud \
- -drive if=none,id=cloud,file=$configimage \
+ -drive if=none,id=cloud,file=cloud.img \
-device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=no,downscript=no,ifname=tap0 \
-daemonize -enable-kvm -display vnc=none \
-serial file:kvm-aarch64_armv7l.txt
@@ -123,16 +123,16 @@ start_qemu_aarch64_armv7l()
start_qemu_armv7l_armv7l()
{
image=$1
- configimage=$2
download_file kernel $GUEST_KERNEL
- qemu-system-arm -smp 2 -m 1024 -cpu cortex-a15 -M vexpress-a15 \
+ set -x
+ qemu-system-arm -smp $GUEST_CORES -m ${GUEST_RAM} -cpu cortex-a15 -M vexpress-a15 \
-kernel $kernel \
- -append 'root=/dev/vdb1 rw rootwait mem=1024M console=ttyAMA0,38400n8' \
+ -append "root=/dev/vdb1 rw rootwait mem=${GUEST_RAM}M console=ttyAMA0,38400n8" \
-device virtio-blk-device,drive=image \
-drive if=none,id=image,file=$image \
-device virtio-blk-device,drive=cloud \
- -drive if=none,id=cloud,file=$configimage \
+ -drive if=none,id=cloud,file=cloud.img \
-device virtio-net-device,netdev=tap0 -netdev tap,id=tap0,script=no,downscript=no,ifname=tap0 \
-daemonize -enable-kvm -display vnc=none \
-serial file:kvm-armv7l_armv7l.txt
@@ -148,10 +148,18 @@ GUEST_ARCH=$1
GUEST_IMAGE=$2
GUEST_FIRMWARE=$3
GUEST_KERNEL=$4
+GUEST_CORES=${5:-2}
+GUEST_RAM=${6:-1024}
download_file IMAGE $GUEST_IMAGE
configure_guest
-start_qemu_${ARCH}_${GUEST_ARCH} ${IMAGE} cloud.img
+if grep -q Juno /proc/device-tree/model
+then
+ echo "Juno detected, forcing a53 cluster"
+ hwloc-bind socket:0 --pid $$
+fi
+
+start_qemu_${ARCH}_${GUEST_ARCH} ${IMAGE}
sleep 10
tail *.txt