feat: improve macOS and *BSD default display device support

The display resolution can be set using `--width` and`--height` for macOS and *BSD.
- close #926
- close #1202
This commit is contained in:
Martin Wimpress 2024-05-12 18:56:39 +01:00 committed by Martin Wimpress
parent 5f9ff30643
commit f09a3b740a
1 changed files with 21 additions and 22 deletions

View File

@ -735,29 +735,28 @@ function vm_boot() {
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 case ${guest_os} in
DISPLAY_DEVICE="vmware-svga" *bsd) DISPLAY_DEVICE="VGA";;
elif [ "${guest_os}" == "linux" ]; then linux_old|solaris) DISPLAY_DEVICE="vmware-svga";;
case ${OUTPUT} in linux)
none|spice|spice-app) DISPLAY_DEVICE="virtio-gpu";; case ${OUTPUT} in
*) DISPLAY_DEVICE="virtio-vga";; none|spice|spice-app) DISPLAY_DEVICE="virtio-gpu";;
esac *) DISPLAY_DEVICE="virtio-vga";;
elif [ "${guest_os}" == "macos" ]; then esac;;
# qxl-vga supports seamless mouse and sane resolutions if only one scanout macos)
# is used. Which is whay '-vga none' is added to the QEMU command line. # qxl-vga and VGA supports seamless mouse and sane resolutions if only
DISPLAY_DEVICE="qxl-vga" # one scanout is used. '-vga none' is added to the QEMU command line
elif [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then # to avoid having two scanouts.
case ${OUTPUT} in DISPLAY_DEVICE="VGA";;
# virtio-gpu "works" with gtk but is limited to 1024x1024 and exhibits other issues. windows|windows-server)
# virtio-gpu "works" with gtk but is limited to 1024x1024 and exhibits other issues
# https://kevinlocke.name/bits/2021/12/10/windows-11-guest-virtio-libvirt/#video # https://kevinlocke.name/bits/2021/12/10/windows-11-guest-virtio-libvirt/#video
gtk|none|spice) DISPLAY_DEVICE="qxl-vga";; case ${OUTPUT} in
sdl|spice-app) DISPLAY_DEVICE="virtio-vga";; gtk|none|spice) DISPLAY_DEVICE="qxl-vga";;
esac sdl|spice-app) DISPLAY_DEVICE="virtio-vga";;
elif [ "${guest_os}" == "solaris" ]; then esac;;
DISPLAY_DEVICE="vmware-svga" *) DISPLAY_DEVICE="qxl-vga";;
else esac
DISPLAY_DEVICE="qxl-vga"
fi
# Map Quickemu OUTPUT to QEMU -display # Map Quickemu OUTPUT to QEMU -display
case ${OUTPUT} in case ${OUTPUT} in