vhost-user-vga: segfault in vga_update_display() after a guest device reset while a display client is attached

Environment: QEMU 11.0.3 as shipped by Proxmox VE 9.2 (pve-qemu-kvm 11.0.3-3), x86_64. The code involved is unchanged in master as of 2026-09-10 (hw/display/vhost-user-gpu.c, hw/display/virtio-vga.c).

Setup:

  • -device vhost-user-vga,chardev=gpu0,... backed by QEMU's vhost-user-gpu --virgl on a host render node;
  • -display dbus,gl=on,rendernode=... with a Display1 client registered as a listener on console 0;
  • a Linux guest on virtio_gpu with virgl, so the console shows the backend's dma-buf scanout.

Steps: with the client attached, reboot the guest from inside (systemctl reboot).

Result: QEMU segfaults when the device is reset:

kvm[...]: segfault at 0 ip ... error 4 in qemu-system-x86_64[4b9e1d,...]

The faulting code is the start of vga_update_display(): surface_bits_per_pixel(qemu_console_surface(s->con)) with a NULL surface. Seen twice, on an NVIDIA RTX 3080 host and an AMD Raphael host. Without an attached client nothing refreshes the console and the reboot completes.

Analysis: vhost_user_gpu_reset() only calls virtio_gpu_base_reset() (enable = 0) and stops the backend. Unlike virtio_gpu_reset(), it does not give the scanout consoles a surface again, so a console keeps its dma-buf scanout and qemu_console_surface() returns NULL. With enable = 0, virtio_vga_base_update_display() takes the VGA path. The next refresh a listener asks for reaches vga_update_display() with that NULL surface: dbus_gl_refresh() calls qemu_console_hw_update() even while the console is GL-blocked. The dma-bufs in g->dmabuf[] are not released on reset either.

Expected: as with virtio-vga, the console falls back to a surface on device reset, and the guest reboots.

Signed-off-by: Dmitry R rdmitry0911@gmail.com