summaryrefslogtreecommitdiff
path: root/src/virt-viewer-app.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-11-12 16:02:50 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2014-11-25 13:00:50 +0100
commit8addab251efb1a96b30058341262da5271475cfb (patch)
tree5e116d7f9959211c78c0052833017af975098c69 /src/virt-viewer-app.c
parent1eaaf8c3ab942417e97aa1da7a625f97620e89a1 (diff)
Report error on attach-only display
Provide error details if the display can only be access through libvirt --attach method.
Diffstat (limited to 'src/virt-viewer-app.c')
-rw-r--r--src/virt-viewer-app.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index c60947f..4800beb 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1204,12 +1204,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;
}