qemu: adjust the meaning of the -s (simple) flag

My primary use case for this flag is to fix booting with UEFI firmware
which can have problems when mixed with KVM, adding kexec into the mix
doesn't help matters either. The current version of OVMF can boot from
virtio drives just fine so that is now enabled and KVM is disabled.

So the -s option can also mean sloooooooow but boots!
This commit is contained in:
Michael Marineau 2014-09-05 19:29:20 -07:00
parent 5bfa0c8d20
commit 1a8b197659

View File

@ -20,7 +20,7 @@ Options:
-c FILE Config drive as an iso or fat filesystem image. -c FILE Config drive as an iso or fat filesystem image.
-a FILE SSH public keys for login access. [~/.ssh/id_{dsa,rsa}.pub] -a FILE SSH public keys for login access. [~/.ssh/id_{dsa,rsa}.pub]
-p PORT The port on localhost to map to the VM's sshd. [2222] -p PORT The port on localhost to map to the VM's sshd. [2222]
-s Safe settings: single simple cpu, ide disks. -s Safe settings: single simple cpu and no KVM.
-h this ;-) -h this ;-)
This script is a wrapper around qemu for starting CoreOS virtual machines. This script is a wrapper around qemu for starting CoreOS virtual machines.
@ -131,11 +131,11 @@ fi
# Start assembling our default command line arguments # Start assembling our default command line arguments
if [ "${SAFE_ARGS}" -eq 1 ]; then if [ "${SAFE_ARGS}" -eq 1 ]; then
disk_type="ide" # Disable KVM, for testing things like UEFI which don't like it
set -- -machine accel=tcg "$@"
else else
disk_type="virtio"
# Emulate the host CPU closely in both features and cores. # Emulate the host CPU closely in both features and cores.
set -- -cpu host -smp "${VM_NCPUS}" "$@" set -- -machine accel=kvm -cpu host -smp "${VM_NCPUS}" "$@"
fi fi
# ${CONFIG_DRIVE} or ${CONFIG_IMAGE} will be mounted in CoreOS as /media/configdrive # ${CONFIG_DRIVE} or ${CONFIG_IMAGE} will be mounted in CoreOS as /media/configdrive
@ -146,11 +146,11 @@ if [ -n "${CONFIG_DRIVE}" ]; then
fi fi
if [ -n "${CONFIG_IMAGE}" ]; then if [ -n "${CONFIG_IMAGE}" ]; then
set -- -drive if=${disk_type},file="${CONFIG_IMAGE}" "$@" set -- -drive if=virtio,file="${CONFIG_IMAGE}" "$@"
fi fi
if [ -n "${VM_IMAGE}" ]; then if [ -n "${VM_IMAGE}" ]; then
set -- -drive if=${disk_type},file="${SCRIPT_DIR}/${VM_IMAGE}" "$@" set -- -drive if=virtio,file="${SCRIPT_DIR}/${VM_IMAGE}" "$@"
fi fi
if [ -n "${VM_KERNEL}" ]; then if [ -n "${VM_KERNEL}" ]; then
@ -173,7 +173,6 @@ fi
qemu-system-x86_64 \ qemu-system-x86_64 \
-name "$VM_NAME" \ -name "$VM_NAME" \
-m ${VM_MEMORY} \ -m ${VM_MEMORY} \
-machine accel=kvm:tcg \
-net nic,vlan=0,model=virtio \ -net nic,vlan=0,model=virtio \
-net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \ -net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
"$@" "$@"