summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-11-12 11:14:19 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2014-11-25 15:07:32 +0100
commit3d5627d79a32bea5337659652e09be0d009940a4 (patch)
treeb8b9ece76dfc9980ba536428103689a03d50f0ea /src/virt-viewer.c
parent8addab251efb1a96b30058341262da5271475cfb (diff)
downloadvirt-viewer-3d5627d79a32bea5337659652e09be0d009940a4.tar.gz
virt-viewer-3d5627d79a32bea5337659652e09be0d009940a4.tar.xz
virt-viewer-3d5627d79a32bea5337659652e09be0d009940a4.zip
virt-viewer: allow connection to unix socket only server
Even when the server doesn't provide a display connection address, virt-viewer is able to connect to guest with libvirt attach.
Diffstat (limited to 'src/virt-viewer.c')
-rw-r--r--src/virt-viewer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index c5fe4da..16b90fa 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -379,17 +379,18 @@ virt_viewer_extract_connect_info(VirtViewer *self,
ghost = virt_viewer_extract_xpath_string(xmldesc, xpath);
} else {
xpath = g_strdup_printf("string(/domain/devices/graphics[@type='%s']/@socket)", type);
- if ((unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath)) == NULL) {
- virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic address for the guest %s"),
- priv->domkey);
- goto cleanup;
- }
+ unixsock = virt_viewer_extract_xpath_string(xmldesc, xpath);
}
- if (ghost && gport)
+ if (ghost && gport) {
g_debug("Guest graphics address is %s:%s", ghost, gport);
- else if (unixsock)
+ } else if (unixsock) {
g_debug("Guest graphics address is %s", unixsock);
+ } else {
+ g_debug("Using direct libvirt connection");
+ retval = TRUE;
+ goto cleanup;
+ }
uri = virConnectGetURI(priv->conn);
if (virt_viewer_util_extract_host(uri, NULL, &host, &transport, &user, &port) < 0) {