Blame SOURCES/libvirt-domain-conf-graphics-Fix-picking-DRI-renderer-automatically-for-SPICE.patch

99cbc7
From 804b6a228fc35d8debb2cfef413c69d10fd57f31 Mon Sep 17 00:00:00 2001
99cbc7
Message-Id: <804b6a228fc35d8debb2cfef413c69d10fd57f31@dist-git>
99cbc7
From: Erik Skultety <eskultet@redhat.com>
99cbc7
Date: Tue, 9 Apr 2019 08:34:36 +0200
99cbc7
Subject: [PATCH] domain: conf: graphics: Fix picking DRI renderer
99cbc7
 automatically for SPICE
99cbc7
MIME-Version: 1.0
99cbc7
Content-Type: text/plain; charset=UTF-8
99cbc7
Content-Transfer-Encoding: 8bit
99cbc7
99cbc7
Commit 255e0732 introduced a few graphics-related helpers. The problem
99cbc7
is that virDomainGraphicsNeedsAutoRenderNode returns true if it gets
99cbc7
NULL as a response from virDomainGraphicsNeedsAutoRenderNode. That's
99cbc7
okay for egl-headless because that one always needs a DRM render node,
99cbc7
the same is not true for SPICE though, and unless the XML specifies
99cbc7
<gl enable='yes'> for SPICE, there's no need for any renderer.
99cbc7
99cbc7
Signed-off-by: Erik Skultety <eskultet@redhat.com>
99cbc7
Reviewed-by: Ján Tomko <jtomko@redhat.com>
99cbc7
(cherry picked from commit 1215195fd882efac47c07c16bfff0ad9a33c45a3)
99cbc7
99cbc7
https: //bugzilla.redhat.com/show_bug.cgi?id=1628892
99cbc7
Signed-off-by: Erik Skultety <eskultet@redhat.com>
99cbc7
Message-Id: <5c8d0a9c4926354df65414bb6b12bff5bcb823f2.1554791287.git.eskultet@redhat.com>
99cbc7
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
99cbc7
---
99cbc7
 src/conf/domain_conf.c | 7 +++++--
99cbc7
 1 file changed, 5 insertions(+), 2 deletions(-)
99cbc7
99cbc7
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
99cbc7
index 1aef0c76f8..aaf6a6bab1 100644
99cbc7
--- a/src/conf/domain_conf.c
99cbc7
+++ b/src/conf/domain_conf.c
99cbc7
@@ -30770,8 +30770,7 @@ virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics)
99cbc7
 
99cbc7
     switch (graphics->type) {
99cbc7
     case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
99cbc7
-        if (graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES)
99cbc7
-            ret = graphics->data.spice.rendernode;
99cbc7
+        ret = graphics->data.spice.rendernode;
99cbc7
         break;
99cbc7
     case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS:
99cbc7
         ret = graphics->data.egl_headless.rendernode;
99cbc7
@@ -30794,6 +30793,10 @@ virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics)
99cbc7
     if (!virDomainGraphicsSupportsRenderNode(graphics))
99cbc7
         return false;
99cbc7
 
99cbc7
+    if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE &&
99cbc7
+        graphics->data.spice.gl != VIR_TRISTATE_BOOL_YES)
99cbc7
+        return false;
99cbc7
+
99cbc7
     if (virDomainGraphicsGetRenderNode(graphics))
99cbc7
         return false;
99cbc7
 
99cbc7
-- 
99cbc7
2.21.0
99cbc7