[RFC PATCH v3 4/7] virtio-gpu: Blame host for virgl blob resource unmapping error

Dmitry Osipenko posted 7 patches 8 hours ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>
[RFC PATCH v3 4/7] virtio-gpu: Blame host for virgl blob resource unmapping error
Posted by Dmitry Osipenko 8 hours ago
Report virgl blob resource unmapping error as a host error since it's
host's fault.

Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
 hw/display/virtio-gpu-virgl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index bc22763cc931..ae8de8ee47da 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -196,9 +196,8 @@ virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g,
 
         ret = virgl_renderer_resource_unmap(res->base.resource_id);
         if (ret) {
-            qemu_log_mask(LOG_GUEST_ERROR,
-                          "%s: failed to unmap virgl resource: %s\n",
-                          __func__, strerror(-ret));
+            error_report("%s: failed to unmap virgl resource: %s",
+                         __func__, strerror(-ret));
             return -1;
         }
     } else {
-- 
2.51.1
Re: [RFC PATCH v3 4/7] virtio-gpu: Blame host for virgl blob resource unmapping error
Posted by Akihiko Odaki 7 hours ago
On 2025/11/20 13:06, Dmitry Osipenko wrote:
> Report virgl blob resource unmapping error as a host error since it's
> host's fault.
> 
> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> ---
>   hw/display/virtio-gpu-virgl.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
> index bc22763cc931..ae8de8ee47da 100644
> --- a/hw/display/virtio-gpu-virgl.c
> +++ b/hw/display/virtio-gpu-virgl.c
> @@ -196,9 +196,8 @@ virtio_gpu_virgl_unmap_resource_blob(VirtIOGPU *g,
>   
>           ret = virgl_renderer_resource_unmap(res->base.resource_id);
>           if (ret) {
> -            qemu_log_mask(LOG_GUEST_ERROR,
> -                          "%s: failed to unmap virgl resource: %s\n",
> -                          __func__, strerror(-ret));
> +            error_report("%s: failed to unmap virgl resource: %s",
> +                         __func__, strerror(-ret));

I'm not sure about this. Unlike plain mmap(), virglrenderer *may* return 
an error because of the current state it has. Skimming the virglrenderer 
code it apparently does not happen, but there is no guarantee.

I also checked crosvm but it didn't help; it don't distinguish guest and 
host errors.

Regards,
Akihiko Odaki