On 27/8/26 09:09, [email protected] wrote:
From: Marc-André Lureau <[email protected]>

All allocation sites used g_new0() which zero-initializes fields.
However share_handle must be SHAREABLE_NONE (-1 on Unix, NULL on
Windows) and dmabuf_fd must be -1, not 0. Centralize allocation and
field initialization in a single constructor to fix this and reduce
code duplication.

This fixes -display dbus with virtio-gpu blob resources. The other
end is currently receiving qemu fd 0.

Signed-off-by: Marc-André Lureau <[email protected]>
---
  hw/display/virtio-gpu-rutabaga.c | 20 +++++-------------
  hw/display/virtio-gpu.c          | 35 +++++++++++++++++++++-----------
  include/hw/virtio/virtio-gpu.h   |  4 ++++
  3 files changed, 32 insertions(+), 27 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

Reply via email to