Hi Marc-André,
On Thu, 12 Nov 2026 15:48:46 +0400, Marc-André Lureau wrote:
> + qemu_console_gl_scanout_disable(scanout->con);
> + qemu_console_set_surface(scanout->con, NULL);
Thanks for the quick fixes. I tested the series on top of master
49559567 with -display dbus,gl=on, vhost-user-vga backed by
vhost-user-gpu --virgl, and a Debian 13 guest.
With this patch QEMU aborts whenever the guest resets the device while
a D-Bus listener is attached, i.e. at the virtio_gpu probe on boot and
again after a reboot:
qemu-system-x86_64: ../ui/dbus-listener.c:625: dbus_scanout_texture:
Assertion `tex_id' failed.
#2 dbus_scanout_texture (tex_id=0, backing_width=720, backing_height=400)
at ../ui/dbus-listener.c:625
#3 dbus_gl_gfx_switch at ../ui/dbus-listener.c:904
#5 displaychangelistener_gfx_switch at ../ui/console.c:242
#6 qemu_console_set_surface at ../ui/console.c:799
#7 vhost_user_gpu_reset at ../hw/display/vhost-user-gpu.c:692
#8 virtio_reset at ../hw/virtio/virtio.c:3454
#10 virtio_pci_reset at ../hw/virtio/virtio-pci.c:2355
#11 memory_region_write_accessor (addr=20, size=1)
at ../system/memory.c:493
#19 kvm_cpu_exec at ../accel/kvm/kvm-all.c:3547
#20 kvm_vcpu_thread_fn at ../accel/kvm/kvm-accel-ops.c:54
(line numbers with all seven patches applied)
The reset comes from the guest's write to the device status register,
so qemu_console_set_surface() runs on the vCPU thread. The placeholder
surface reaches the listener without a texture, presumably because the
display's EGL context is not current on that thread. virtio_gpu_reset()
runs the same work through reset_bh in the main loop when it is called
from a vCPU thread.
Without a listener attached the series passed all our tests; the
results for the other patches are in my replies to them and in
https://gitlab.com/qemu-project/qemu/-/issues/4846.
Dmitry