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

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