From cf2c7c6b5ee1b636d7f443a4442374e9e254c164 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Thu, 3 Oct 2019 17:18:58 -0300
Subject: [PATCH] proxy: Do not overwrite certificate data from display
Since oVirt 4.3, certificate data is available from the XML see:
https://bugzilla.redhat.com/show_bug.cgi?id=1403161
Previous commit adds support for using that value instead of the one
obtained from proxy object.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-proxy.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 9cdd211..74604dd 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -632,6 +632,14 @@ static void ovirt_proxy_update_vm_display_ca(OvirtProxy *proxy)
g_object_get(G_OBJECT(vm), "display", &display, NULL);
if (display != NULL) {
+ GByteArray *ca_cert = NULL;
+ g_object_get(G_OBJECT(display), "ca-cert", &ca_cert, NULL);
+ if (ca_cert != NULL) {
+ g_byte_array_unref(ca_cert);
+ ca_cert = NULL;
+ continue;
+ }
+
g_object_set(G_OBJECT(display),
"ca-cert", proxy->priv->display_ca,
NULL);
--
2.21.0