[virt-viewer] ovirt: Fix initial connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After commit df42f78d46 "remote-viewer: factor our
remote_viewer_initial_connect()", the initial connection code only gets
run in the !ovirt case. When ovirt is in use, the initial connection
never happens, meaning all we get when using ovirt:// is a blank
virt-viewer window.

This commit fixes that by moving creation of the ovirt session to
remote_viewer_initial_connect, and unconditionnally calling the
remote_viewer_initial_connect rather than only doing it in the !ovirt
case.

https://bugzilla.redhat.com/show_bug.cgi?id=1655537

Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
---
 src/remote-viewer.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 4e1021b..989466b 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -684,9 +684,18 @@ remote_viewer_initial_connect(RemoteViewer *self, const gchar *type, const gchar
 {
     VirtViewerApp *app = VIRT_VIEWER_APP(self);
 
-    if (!virt_viewer_app_create_session(app, type, error))
-        return FALSE;
-
+#ifdef HAVE_OVIRT
+    if (g_strcmp0(type, "ovirt") == 0) {
+        if (!create_ovirt_session(app, guri, error)) {
+            g_prefix_error(error, _("Couldn't open oVirt session: "));
+            return FALSE;
+        }
+    } else
+#endif
+    {
+        if (!virt_viewer_app_create_session(app, type, error))
+            return FALSE;
+    }
 
     g_signal_connect(virt_viewer_app_get_session(app), "session-connected",
                      G_CALLBACK(remote_viewer_session_connected), g_strdup(guri));
@@ -782,18 +791,8 @@ retry_dialog:
                                 _("Cannot determine the connection type from URI"));
             goto cleanup;
         }
-#ifdef HAVE_OVIRT
-        if (g_strcmp0(type, "ovirt") == 0) {
-            if (!create_ovirt_session(app, guri, &error)) {
-                g_prefix_error(&error, _("Couldn't open oVirt session: "));
-                goto cleanup;
-            }
-        } else
-#endif
-        {
-            if (!remote_viewer_initial_connect(self, type, guri, vvfile, &error))
-                goto cleanup;
-        }
+        if (!remote_viewer_initial_connect(self, type, guri, vvfile, &error))
+            goto cleanup;
     }
 
     ret = VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->start(app, &error);
-- 
2.19.2

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux