Dmitry Osipenko <[email protected]> writes: > Make virtio_gpu_virgl_init() return -1 on error to make it consistent > with virtio_gpu_virgl_reset() in regards to error handling codding style, > adhering to QEMU's devel/style recommendations.
See previous comment on other -1 returns. > > Signed-off-by: Dmitry Osipenko <[email protected]> > --- > hw/display/virtio-gpu-gl.c | 2 +- > hw/display/virtio-gpu-virgl.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c > index bca7d489c1e3..d65da4863923 100644 > --- a/hw/display/virtio-gpu-gl.c > +++ b/hw/display/virtio-gpu-gl.c > @@ -78,7 +78,7 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, > VirtQueue *vq) > } > /* fallthrough */ > case RS_START: > - if (virtio_gpu_virgl_init(g)) { > + if (virtio_gpu_virgl_init(g) < 0) { > gl->renderer_state = RS_INIT_FAILED; > return; > } > diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c > index 91951c3ffb0a..9b36b378c2fd 100644 > --- a/hw/display/virtio-gpu-virgl.c > +++ b/hw/display/virtio-gpu-virgl.c > @@ -1371,7 +1371,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) > * Async-fence was bugged in virglrenderer versions <= 1.1.1. > */ > error_report("drm requires egl display and virglrenderer >= > 1.2.0"); > - return -EINVAL; > + return -1; > } > } > #endif > @@ -1379,7 +1379,7 @@ int virtio_gpu_virgl_init(VirtIOGPU *g) > ret = virgl_renderer_init(g, flags, &virtio_gpu_3d_cbs); > if (ret != 0) { > error_report("virgl could not be initialized: %d", ret); > - return ret; > + return -1; > } > > gl->fence_poll = timer_new_ms(QEMU_CLOCK_VIRTUAL, -- Alex Bennée Virtualisation Tech Lead @ Linaro
