fix(wsl): suppress error getting sys_vendor when running on WSL2

This commit is contained in:
Martin Wimpress 2024-05-16 14:05:59 +01:00 committed by Martin Wimpress
parent 3e6acd8c98
commit 1b6cf0ad69
1 changed files with 3 additions and 1 deletions

View File

@ -300,7 +300,9 @@ function configure_cpu() {
# QEMU for macOS from Homebrew does not support SMM
SMM="off"
else
MANUFACTURER=$(head -1 /sys/class/dmi/id/sys_vendor)
if [ -r /sys/class/dmi/id/sys_vendor ]; then
MANUFACTURER=$(head -1 /sys/class/dmi/id/sys_vendor)
fi
CPU_KVM_UNHALT=",kvm_pv_unhalt"
GUEST_TWEAKS+=" -global kvm-pit.lost_tick_policy=discard"
QEMU_ACCEL="kvm"