Add $CPU variable to enable guest_os specific tweaks

This commit is contained in:
Martin Wimpress 2020-03-21 15:21:16 +00:00
parent 2dfe88bd5a
commit 061abfe9b5
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -90,6 +90,7 @@ function vm_boot() {
local VMNAME=$(basename ${VM} .conf) local VMNAME=$(basename ${VM} .conf)
local VMDIR=$(dirname ${disk_img}) local VMDIR=$(dirname ${disk_img})
local BIOS="" local BIOS=""
local CPU="-cpu host,kvm=on"
local VIDEO_DRV="" local VIDEO_DRV=""
local GL="on" local GL="on"
local VIRGL="on" local VIRGL="on"
@ -123,6 +124,7 @@ function vm_boot() {
VIDEO_DRV="virtio-vga" VIDEO_DRV="virtio-vga"
;; ;;
windows) windows)
CPU="${CPU},hv_time"
VIDEO_DRV="qxl" VIDEO_DRV="qxl"
;; ;;
*) *)
@ -268,7 +270,7 @@ function vm_boot() {
${ISO_BOOT} ${ISO_DRIVER} \ ${ISO_BOOT} ${ISO_DRIVER} \
-enable-kvm \ -enable-kvm \
-machine q35 \ -machine q35 \
-cpu host,kvm=on \ ${CPU} \
-smp ${CORES_VM} \ -smp ${CORES_VM} \
-m ${RAM_VM} \ -m ${RAM_VM} \
-device virtio-balloon \ -device virtio-balloon \