[PATCH virt-viewer 9/9] Report error on attach-only display

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

 



Provide error details if the display can only be access through libvirt
--attach method.
---
 src/virt-viewer-app.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index e2d9636..5d5c217 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1201,12 +1201,15 @@ virt_viewer_app_default_activate(VirtViewerApp *self, GError **error)
     } else if (priv->guri) {
         virt_viewer_app_trace(self, "Opening connection to display at %s", priv->guri);
         return virt_viewer_session_open_uri(VIRT_VIEWER_SESSION(priv->session), priv->guri, error);
-    } else {
+    } else if (priv->ghost) {
         virt_viewer_app_trace(self, "Opening direct TCP connection to display at %s:%s:%s",
                               priv->ghost, priv->gport, priv->gtlsport ? priv->gtlsport : "-1");
         return virt_viewer_session_open_host(VIRT_VIEWER_SESSION(priv->session),
                                              priv->ghost, priv->gport, priv->gtlsport);
-    }
+    } else {
+        g_set_error_literal(error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
+                            _("Display can only be attached through libvirt with --attach"));
+   }
 
     return FALSE;
 }
-- 
1.9.3

_______________________________________________
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