> Subject: Re: [RFC 5/6] virtio-gpu: Recreate the resource's dmabuf if new
> backing is attached
>
> On 2025/09/03 7:42, Vivek Kasireddy wrote:
> > There are cases when a blob resource's backing might get detached
> > and re-attached again such as when the underlying object is getting
> > migrated in the Guest. In these situations, we need to obtain a new
> > dmabuf fd, which can be done by calling virtio_gpu_init_udmabuf().
>
> It sounds like a bug fix. Perhaps you may add a Fixes: tag and reorder
> patches to make this change come first.
Sure, I can do that.
Thanks,
Vivek
>
> >
> > Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> > Cc: Alex Bennée <alex.bennee@linaro.org>
> > Cc: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> > Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> > Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> > ---
> > hw/display/virtio-gpu.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> > index 2f9133c3b6..1654a417b8 100644
> > --- a/hw/display/virtio-gpu.c
> > +++ b/hw/display/virtio-gpu.c
> > @@ -938,6 +938,10 @@ virtio_gpu_resource_attach_backing(VirtIOGPU
> *g,
> > cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
> > return;
> > }
> > +
> > + if (res->blob_size && res->dmabuf_fd < 0) {
> > + virtio_gpu_init_udmabuf(res);
> > + }
> > }
> >
> > static void