On 2026/01/16 22:08, Dmitry Osipenko wrote:
On 1/13/26 07:47, Akihiko Odaki wrote:
+void virtio_gpu_virgl_resource_destroy(VirtIOGPU *g,
+ struct
virtio_gpu_simple_resource *base,
+ Error **errp)
An error reporting rule described in include/qapi/error.h requires
functions that use Error to return a value indicating success or failure.
For this particular case, I think it can simply return what
virtio_gpu_virgl_resource_unref() returns, without having errp.
The error reporting arg is added here because resource_destroy()
callback of VirtIOGPUClass requires it:
```
vgc->resource_destroy = virtio_gpu_virgl_resource_destroy;
```
I missed that line. That is my fault.
The include/qapi/error.h says "Whenever practical, also return a value
that indicates success / failure". Hence, the returned value is optional.
I don't quite see how errp can be avoided.
Perhaps you're meaning to add virtio_gpu_gl_resource_destroy() that will
be local to virtio-gpu-gl.c. Will change this in v10, otherwise please
clarify more your suggestion.
Let's keep this way. The error handling infrastructure intentionally
allows to specify NULL when you don't care the error, so we don't need
another function to dismiss the error.