refactor: simplify setting the default display resolution

This commit is contained in:
Martin Wimpress 2024-05-12 17:47:04 +01:00 committed by Martin Wimpress
parent a9576fb3a4
commit db1e602cf1
1 changed files with 7 additions and 9 deletions

View File

@ -727,14 +727,12 @@ function vm_boot() {
esac esac
# Determine a sane resolution for Linux guests. # Determine a sane resolution for Linux guests.
#if [ "${guest_os}" == "linux" ]; then local X_RES="1280"
local X_RES="1280" local Y_RES="800"
local Y_RES="800" if [ -n "${width}" ] && [ -n "${height}" ]; then
if [ -n "${width}" ] && [ -n "${height}" ]; then local X_RES="${width}"
local X_RES="${width}" local Y_RES="${height}"
local Y_RES="${height}" fi
fi
#fi
# https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ # https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/
if [ "${guest_os}" == "linux_old" ]; then if [ "${guest_os}" == "linux_old" ]; then
@ -786,7 +784,7 @@ function vm_boot() {
VIDEO="-device ${DISPLAY_DEVICE}" VIDEO="-device ${DISPLAY_DEVICE}"
# Try and coerce the display resolution for Linux guests only. # Try and coerce the display resolution for Linux guests only.
if [ "${guest_os}" == "linux" ]; then if [ "${DISPLAY_DEVICE}" != "vmware-svga" ]; then
VIDEO="${VIDEO},xres=${X_RES},yres=${Y_RES}" VIDEO="${VIDEO},xres=${X_RES},yres=${Y_RES}"
echo " @ (${X_RES} x ${Y_RES})" echo " @ (${X_RES} x ${Y_RES})"
else else