Blame SOURCES/0002-ovirt-Fix-initial-connection.patch

7ba0ec
From fe7aad2002ebbeef4c99e1777371e71c9b3dcb7b Mon Sep 17 00:00:00 2001
7ba0ec
From: Christophe Fergeau <cfergeau@redhat.com>
7ba0ec
Date: Thu, 6 Dec 2018 11:57:12 +0100
7ba0ec
Subject: [PATCH] ovirt: Fix initial connection
7ba0ec
7ba0ec
After commit df42f78d46 "remote-viewer: factor our
7ba0ec
remote_viewer_initial_connect()", the initial connection code only gets
7ba0ec
run in the !ovirt case. When ovirt is in use, the initial connection
7ba0ec
never happens, meaning all we get when using ovirt:// is a blank
7ba0ec
virt-viewer window.
7ba0ec
7ba0ec
This commit fixes that by moving creation of the ovirt session to
7ba0ec
remote_viewer_initial_connect, and unconditionnally calling the
7ba0ec
remote_viewer_initial_connect rather than only doing it in the !ovirt
7ba0ec
case.
7ba0ec
7ba0ec
https://bugzilla.redhat.com/show_bug.cgi?id=1655537
7ba0ec
7ba0ec
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
7ba0ec
---
7ba0ec
 src/remote-viewer.c | 29 ++++++++++++++---------------
7ba0ec
 1 file changed, 14 insertions(+), 15 deletions(-)
7ba0ec
7ba0ec
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
7ba0ec
index 4e1021b..989466b 100644
7ba0ec
--- a/src/remote-viewer.c
7ba0ec
+++ b/src/remote-viewer.c
7ba0ec
@@ -684,9 +684,18 @@ remote_viewer_initial_connect(RemoteViewer *self, const gchar *type, const gchar
7ba0ec
 {
7ba0ec
     VirtViewerApp *app = VIRT_VIEWER_APP(self);
7ba0ec
 
7ba0ec
-    if (!virt_viewer_app_create_session(app, type, error))
7ba0ec
-        return FALSE;
7ba0ec
-
7ba0ec
+#ifdef HAVE_OVIRT
7ba0ec
+    if (g_strcmp0(type, "ovirt") == 0) {
7ba0ec
+        if (!create_ovirt_session(app, guri, error)) {
7ba0ec
+            g_prefix_error(error, _("Couldn't open oVirt session: "));
7ba0ec
+            return FALSE;
7ba0ec
+        }
7ba0ec
+    } else
7ba0ec
+#endif
7ba0ec
+    {
7ba0ec
+        if (!virt_viewer_app_create_session(app, type, error))
7ba0ec
+            return FALSE;
7ba0ec
+    }
7ba0ec
 
7ba0ec
     g_signal_connect(virt_viewer_app_get_session(app), "session-connected",
7ba0ec
                      G_CALLBACK(remote_viewer_session_connected), g_strdup(guri));
7ba0ec
@@ -782,18 +791,8 @@ retry_dialog:
7ba0ec
                                 _("Cannot determine the connection type from URI"));
7ba0ec
             goto cleanup;
7ba0ec
         }
7ba0ec
-#ifdef HAVE_OVIRT
7ba0ec
-        if (g_strcmp0(type, "ovirt") == 0) {
7ba0ec
-            if (!create_ovirt_session(app, guri, &error)) {
7ba0ec
-                g_prefix_error(&error, _("Couldn't open oVirt session: "));
7ba0ec
-                goto cleanup;
7ba0ec
-            }
7ba0ec
-        } else
7ba0ec
-#endif
7ba0ec
-        {
7ba0ec
-            if (!remote_viewer_initial_connect(self, type, guri, vvfile, &error))
7ba0ec
-                goto cleanup;
7ba0ec
-        }
7ba0ec
+        if (!remote_viewer_initial_connect(self, type, guri, vvfile, &error))
7ba0ec
+            goto cleanup;
7ba0ec
     }
7ba0ec
 
7ba0ec
     ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->start(app, &error);
7ba0ec
-- 
7ba0ec
2.19.2
7ba0ec