summaryrefslogtreecommitdiffstats
path: root/src/remote-viewer.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-01-22 16:45:01 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-03-12 17:48:22 +0100
commitf9577b9197b737be722cfd5632b6077ce6b041ff (patch)
treebcabac819486c0051f4b46c7def944745d4b0623 /src/remote-viewer.c
parent21306d13f931153a6eb13f455ca7d8fedc800f78 (diff)
downloadvirt-viewer-f9577b9197b737be722cfd5632b6077ce6b041ff.tar.gz
virt-viewer-f9577b9197b737be722cfd5632b6077ce6b041ff.tar.xz
virt-viewer-f9577b9197b737be722cfd5632b6077ce6b041ff.zip
ovirt: Take into account SPICE proxy
VMs managed by oVirt can be hidden behind a proxy. This commit allows remote-viewer to make use of this information when it's available A recent oVirt instance is needed so that it's available through the REST API, as well as libgovirt 0.3.3 or newer. With older oVirt/libgovirt versions, the worst that can happen is a runtime warning in the console, and an impossibility to connect to VMs behind a proxy, so this commit is not raising the minimum libgovirt requirement.
Diffstat (limited to 'src/remote-viewer.c')
-rw-r--r--src/remote-viewer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 4c97a12..1eb5f25 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -828,6 +828,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
gboolean success = FALSE;
guint port;
guint secure_port;
+ char *proxy_url = NULL;
OvirtVmDisplayType type;
const char *session_type;
@@ -908,6 +909,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
"secure-port", &secure_port,
"ticket", &ticket,
"host-subject", &host_subject,
+ "proxy-url", &proxy_url,
NULL);
gport = g_strdup_printf("%d", port);
gtlsport = g_strdup_printf("%d", secure_port);
@@ -946,6 +948,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
g_object_set(G_OBJECT(session),
"password", ticket,
"cert-subject", host_subject,
+ "proxy", proxy_url,
NULL);
g_object_get(G_OBJECT(proxy), "ca-cert", &ca_cert, NULL);
if (ca_cert != NULL) {
@@ -969,6 +972,7 @@ error:
g_free(ghost);
g_free(host_subject);
g_free(guid);
+ g_free(proxy_url);
if (error != NULL)
g_propagate_error(err, error);