使用 OpenGL 重新編譯 QEMU,但 virt-manager 或 libvirt 告訴我此 QEMU 不支援 SPICE OpenGL

使用 OpenGL 重新編譯 QEMU,但 virt-manager 或 libvirt 告訴我此 QEMU 不支援 SPICE OpenGL

我想根據這個部落格使用 virtio-gpu:

https://www.kraxel.org/blog/2016/09/using-virtio-gpu-with-libvirt-and-spice/

我正在使用 Debian 測試,但是當我運行時,官方 debian 來源中的 QEMU 不支援 OpenGL

qemu-system-x86_64 -display sdl,gl=on

它說

SDL1 display code has no opengl support.
Please recompile qemu with SDL2, using
./configure --enable-sdl --with-sdlabi=2.0
qemu-system-x86_64: OpenGL support is disabled

所以我用這些選項重新編譯了 QEMU。

成功後,當我跑步時

qemu-system-x86_64 -display sdl,gl=on

再次,它啟動了一個視窗並繼續。

但是當我添加

<graphics type='spice'>
  <listen type='none'/>
  <gl enable='yes'/>
</graphics>
<video>
  <model type='virtio'/>
</video>

到我的libvirt domian檔案並啟動,libvirt提示:

error: Failed to start domain debian9-xfce
error: unsupported configuration: This QEMU doesn't support spice OpenGL

我已經安裝了這些套件:

gir1.2-spice-client-gtk-3.0=0.33-3.3
libspice-server1=0.13.90-0.2
libvirglrenderer0=0.6.0-2
mesa-utils=8.3.0-5
libepoxy0=1.3.1-3

我發現了那裡是 QEMU OpenGL 支援的 libvirt 補丁:

+    if (graphics->data.spice.gl) {
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_GL)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("This QEMU doesn't support spice OpenGL"));
+            goto error;
+        }

但我不知道如何virQEMUCapsGet獲得 QEMU 功能,因為我已經編譯了支援 OpenGL 的 QEMU。

相關內容