]> git.proxmox.com Git - qemu-server.git/commitdiff
check prerequisites for virtio-gl display
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 29 Apr 2022 16:50:07 +0000 (18:50 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 2 May 2022 15:15:42 +0000 (17:15 +0200)
and exit early if they are not met.
The necessary libraries were taken from Thomas' post in our community
forum:
https://forum.proxmox.com/threads/.61801/post-466767 (ff)

The /dev/dri/renderD.* check is based on util/drm.c in the current
qemu source code.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/QemuServer.pm

index 8e7cfb86315913c3741424c12f73875b520a759f..1290f3387ef0b04b5c6f2ba94744e904b1db68d9 100644 (file)
@@ -1880,6 +1880,17 @@ sub print_vga_device {
        $pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine);
     }
 
+    if ($vga->{type} eq 'virtio-gl') {
+       if ( ! -e '/usr/lib/x86_64-linux-gnu/libEGL.so.1' ||
+           ! -e '/usr/lib/x86_64-linux-gnu/libGL.so.1') {
+           die "missing libraries for '$vga->{type}' detected (install libgl1 and libegl1)\n";
+       }
+
+       if ( ! PVE::Tools::dir_glob_regex('/dev/dri/', "renderD.*")) {
+           die "no drm render node detected (/dev/dri/renderD*) - needed for '$vga->{type}' display\n";
+       }
+    }
+
     return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}";
 }