Hi Marc-André,

On Fri, 13 Nov 2026 14:42:16 +0400, Marc-André Lureau wrote:
> Defer the display cleanup to a bottom half, as virtio_gpu_reset() does,
> and wait for it when reset is triggered from a vCPU thread.

This fixes the abort I reported on v1. Same setup as before (master
49559567 + v2, -display dbus,gl=on, vhost-user-vga backed by
vhost-user-gpu --virgl, Debian 13 guest, a D-Bus listener attached):
QEMU and vhost-user-gpu stay up through the guest's virtio_gpu probe
and through five system_reset/boot cycles in a row, and the listener
receives a new ScanoutDMABUF after each of them.

There is one new abort, though:

> @@ -631,13 +632,16 @@ vhost_user_gpu_instance_finalize(Object *obj)
> [...]
> +    g_clear_pointer(&g->reset_bh, qemu_bh_delete);
> +    qemu_cond_destroy(&g->reset_cond);

reset_cond is initialized at the end of realize but destroyed in
instance_finalize, so finalizing an instance that was never realized
aborts:

  qemu-system-x86_64: ../util/qemu-thread-posix.c:207: qemu_cond_destroy: 
Assertion `cond->initialized' failed.

With v2 this happens on
  - qemu-system-x86_64 -device vhost-user-gpu-pci,help
    (the same with vhost-user-vga);
  - QMP device-list-properties with typename vhost-user-gpu-pci;
  - a device_add of vhost-user-gpu-pci that is refused, e.g. with
    "Device 'vhost-user-gpu-pci' does not support hotplugging" on q35;
and tests/qtest/device-introspect-test fails in
/x86_64/device/introspect/concrete/defaults/none. Master passes all of
them. virtio-gpu destroys its reset_cond in unrealize.

I'll retest v3 and send Tested-by for 3/8 and 4/8 then.

Dmitry


Reply via email to