diff options
author | Dmitry Osipenko <dmitry.osipenko@collabora.com> | 2024-10-25 00:03:02 +0300 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-10-28 16:56:35 +0000 |
commit | 7e688d1bf515316e1e334eb5dcb3dd1577810fe3 (patch) | |
tree | f0c3a682b24a275c17488fc0082b43e379d30ab0 /include | |
parent | a0a8f47fd0d5dc11487bb65e005700d7b984a207 (diff) | |
download | qemu-7e688d1bf515316e1e334eb5dcb3dd1577810fe3.zip qemu-7e688d1bf515316e1e334eb5dcb3dd1577810fe3.tar.gz qemu-7e688d1bf515316e1e334eb5dcb3dd1577810fe3.tar.bz2 |
virtio-gpu: Handle virtio_gpu_virgl_init() failure
virtio_gpu_virgl_init() may fail, leading to a further Qemu crash
because Qemu assumes it never fails. Check virtio_gpu_virgl_init()
return code and don't execute virtio commands on error. Failed
virtio_gpu_virgl_init() will result in a timed out virtio commands
for a guest OS.
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Message-Id: <20241024210311.118220-5-dmitry.osipenko@collabora.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/virtio/virtio-gpu.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 18b6c3b..7177524 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -222,11 +222,18 @@ struct VirtIOGPUClass { Error **errp); }; +/* VirtIOGPUGL renderer states */ +typedef enum { + RS_START, /* starting state */ + RS_INIT_FAILED, /* failed initialisation */ + RS_INITED, /* initialised and working */ + RS_RESET, /* inited and reset pending, moves to start after reset */ +} RenderState; + struct VirtIOGPUGL { struct VirtIOGPU parent_obj; - bool renderer_inited; - bool renderer_reset; + RenderState renderer_state; QEMUTimer *fence_poll; QEMUTimer *print_stats; |