From: Steve McIntyre Date: Mon, 11 May 2020 12:07:49 +0000 (+0100) Subject: Tweaks to support 32- and 64-bit VMs better X-Git-Url: https://git.einval.com/cgi-bin/gitweb.cgi?p=training-lab.git;a=commitdiff_plain;h=359b0be0e55cc8244a9e052714a3863ff19621dc;ds=inline Tweaks to support 32- and 64-bit VMs better --- diff --git a/scripts/start_runtime b/scripts/start_runtime index 7808149..01307dc 100755 --- a/scripts/start_runtime +++ b/scripts/start_runtime @@ -13,10 +13,12 @@ case $MACHINE in [ "$MACH"x = "aarch64"x ] || \ [ "$MACH"x = "arm64" ] ; then MACH=aarch64 + QEMU=qemu-system-aarch64 CPU_OPTS="-cpu host --enable-kvm" MACH_OPTS="-machine virt,gic-version=host,kernel_irqchip=on" elif [ "$MACH"x = "arm"x ]; then MACH=arm + QEMU=qemu-system-aarch64 CPU_OPTS="-cpu host,aarch64=off --enable-kvm" MACH_OPTS="-machine virt,gic-version=host,kernel_irqchip=on" else @@ -29,10 +31,12 @@ case $MACHINE in [ "$MACH"x = "aarch64"x ] || \ [ "$MACH"x = "arm64" ] ; then MACH=aarch64 + QEMU=qemu-system-aarch64 CPU_OPTS="-cpu cortex-a57" MACH_OPTS="-M virt" elif [ "$MACH"x = "arm"x ]; then MACH=arm + QEMU=qemu-system-arm CPU_OPTS="-cpu cortex-a15" MACH_OPTS="-M virt" else @@ -50,6 +54,9 @@ fi DISPLAY="-daemonize -vnc :1" PFLASH="-pflash $MACH-OVMF.fd -pflash $MACH-storage.fd" +if [ "$CD"x != ""x ]; then + CD="-device virtio-scsi-pci,id=scsi -drive if=none,id=cd,file=$CD,readonly -device scsi-cd,drive=cd,bootindex=0" +fi if [ "$NOSHARE"x = ""x ]; then P9="-virtfs local,path=$SHARE/,mount_tag=host0,security_model=passthrough,id=host0" @@ -64,12 +71,13 @@ NET="$NET,id=eth0" NET="$NET,hostfwd=tcp:127.0.0.1:${SSH_PORT}-10.0.2.15:22" NET="$NET -device virtio-net-device,netdev=eth0" -CMD="qemu-system-$MACH -m $MEM \ +CMD="$QEMU -m $MEM \ $DISPLAY \ $MACH_OPTS $CPU_OPTS \ $PFLASH \ -drive file=$DISK,format=raw,if=virtio \ $NET \ + $CD \ $P9" echo $CMD