[PATCH] ui/spice-app: honor gl=off option, reject core/es

marcandre.lureau@redhat.com posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261005091459.737182-2-marcandre.lureau@redhat.com
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>
ui/spice-app.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
[PATCH] ui/spice-app: honor gl=off option, reject core/es
Posted by marcandre.lureau@redhat.com 1 month, 2 weeks ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

With -display spice-app, the value of the gl option is ignored: gl=off
enables OpenGL exactly like gl=on. Only omitting the option keeps OpenGL
disabled.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4639
Fixes: d8aec9d9f129 ("display: add -display spice-app launching a Spice client")
Reported-by: @jeremie.b
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/spice-app.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ui/spice-app.c b/ui/spice-app.c
index fe3df62bfa5d..90e8de0bc87d 100644
--- a/ui/spice-app.c
+++ b/ui/spice-app.c
@@ -180,8 +180,14 @@ static void spice_app_display_early_init(DisplayOptions *opts)
     qemu_opt_set(qopts, "image-compression", "off", &error_abort);
     qemu_opt_set(qopts, "streaming-video", "off", &error_abort);
 #ifdef HAVE_SPICE_GL
-    qemu_opt_set(qopts, "gl", opts->has_gl ? "on" : "off", &error_abort);
-    display_opengl = opts->has_gl;
+    if (opts->has_gl &&
+        opts->gl != DISPLAY_GL_MODE_ON &&
+        opts->gl != DISPLAY_GL_MODE_OFF) {
+        error_report("spice-app only supports gl=on/off");
+        exit(1);
+    }
+    display_opengl = opts->has_gl && opts->gl != DISPLAY_GL_MODE_OFF;
+    qemu_opt_set(qopts, "gl", display_opengl ? "on" : "off", &error_abort);
 #endif
 }
 
-- 
2.56.0.rc0.29.g47ce80527c56


Re: [PATCH] ui/spice-app: honor gl=off option, reject core/es
Posted by Daniel P. Berrangé 1 month, 2 weeks ago
On Mon, Oct 05, 2026 at 01:15:00PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> With -display spice-app, the value of the gl option is ignored: gl=off
> enables OpenGL exactly like gl=on. Only omitting the option keeps OpenGL
> disabled.
> 
> Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4639
> Fixes: d8aec9d9f129 ("display: add -display spice-app launching a Spice client")
> Reported-by: @jeremie.b
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/spice-app.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|