From 12e0f8dddd5856b80b6485c51a85b1064deda80b Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 17 Jan 2014 00:23:24 -0800 Subject: [PATCH] fix(qemu): Enable all available CPU features and SMP by default --- build_library/qemu_template.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_library/qemu_template.sh b/build_library/qemu_template.sh index b04917a99c..6947f8197b 100755 --- a/build_library/qemu_template.sh +++ b/build_library/qemu_template.sh @@ -5,6 +5,7 @@ VM_NAME= VM_UUID= VM_IMAGE= VM_MEMORY= +VM_NCPUS="`grep -c ^processor /proc/cpuinfo`" IMAGE_PATH="${SCRIPT_DIR}/${VM_IMAGE}" SSH_PORT=2222 SSH_KEYS="" @@ -74,11 +75,14 @@ fi # Default to KVM, fall back on full emulation +# Emulate the host CPU closely in both features and cores. # ${METADATA} will be mounted in CoreOS as /media/metadata qemu-system-x86_64 \ -name "$VM_NAME" \ -uuid "$VM_UUID" \ -m ${VM_MEMORY} \ + -cpu host \ + -smp "${VM_NCPUS}" \ -machine accel=kvm:tcg \ -drive index=0,if=virtio,media=disk,format=qcow2,file="${IMAGE_PATH}" \ -net nic,vlan=0,model=virtio \