Commit 675344a0a0 for qemu.org

commit 675344a0a0b4871a8b07825e18eae5872855684b
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Thu Aug 20 23:54:46 2026 +0400

    ui/console: disable GL scanout when dmabuf is the active one

    Disable the GL scanout when the actively-displayed dmabuf is released,
    so the console does not retain a stale reference.

    The VFIO commit changes to call qemu_console_gl_release_dmabuf() before
    qemu_graphic_console_close(), which dereferences the active scanout.

    Fixes: 239b7c5705a4 ("vfio/pci: close display console during unrealize, not finalize")
    Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

diff --git a/ui/console.c b/ui/console.c
index a8a2a247d8..14f148118e 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1049,6 +1049,9 @@ void qemu_console_gl_release_dmabuf(QemuConsole *con,
             dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf);
         }
     }
+    if (con->scanout.kind == SCANOUT_DMABUF && dmabuf == con->scanout.dmabuf) {
+        qemu_console_gl_scanout_disable(con);
+    }
 }

 void qemu_console_gl_update(QemuConsole *con,