mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
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:
parent
5bfa0c8d20
commit
1a8b197659
@ -20,7 +20,7 @@ Options:
|
||||
-c FILE Config drive as an iso or fat filesystem image.
|
||||
-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]
|
||||
-s Safe settings: single simple cpu, ide disks.
|
||||
-s Safe settings: single simple cpu and no KVM.
|
||||
-h this ;-)
|
||||
|
||||
This script is a wrapper around qemu for starting CoreOS virtual machines.
|
||||
@ -131,11 +131,11 @@ fi
|
||||
|
||||
# Start assembling our default command line arguments
|
||||
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
|
||||
disk_type="virtio"
|
||||
# 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
|
||||
|
||||
# ${CONFIG_DRIVE} or ${CONFIG_IMAGE} will be mounted in CoreOS as /media/configdrive
|
||||
@ -146,11 +146,11 @@ if [ -n "${CONFIG_DRIVE}" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "${CONFIG_IMAGE}" ]; then
|
||||
set -- -drive if=${disk_type},file="${CONFIG_IMAGE}" "$@"
|
||||
set -- -drive if=virtio,file="${CONFIG_IMAGE}" "$@"
|
||||
fi
|
||||
|
||||
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
|
||||
|
||||
if [ -n "${VM_KERNEL}" ]; then
|
||||
@ -173,7 +173,6 @@ fi
|
||||
qemu-system-x86_64 \
|
||||
-name "$VM_NAME" \
|
||||
-m ${VM_MEMORY} \
|
||||
-machine accel=kvm:tcg \
|
||||
-net nic,vlan=0,model=virtio \
|
||||
-net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22,hostname="${VM_NAME}" \
|
||||
"$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user