Blame SOURCES/0047-vm-display-Add-support-for-parsing-certificate-data.patch

7de552
From 0fceae5b08888ae04d0f984aaa2583ca39756880 Mon Sep 17 00:00:00 2001
7de552
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
7de552
Date: Thu, 3 Oct 2019 15:30:46 -0300
7de552
Subject: [PATCH] vm-display: Add support for parsing certificate data
7de552
7de552
Certificate data is stored as GByteArray, thus requiring support for
7de552
G_TYPE_BYTE_ARRAY in ovirt-utils.
7de552
7de552
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1402909
7de552
7de552
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
7de552
---
7de552
 govirt/ovirt-utils.c      | 5 +++++
7de552
 govirt/ovirt-vm-display.c | 3 +++
7de552
 2 files changed, 8 insertions(+)
7de552
7de552
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
7de552
index 56ce2e1..7789296 100644
7de552
--- a/govirt/ovirt-utils.c
7de552
+++ b/govirt/ovirt-utils.c
7de552
@@ -181,6 +181,7 @@ _set_property_value_from_type(GValue *value,
7de552
     const char *value_str;
7de552
     GType type = prop->value_type;
7de552
 
7de552
+    /* These types do not require a value associated */
7de552
     if (g_type_is_a(type, OVIRT_TYPE_RESOURCE)) {
7de552
         OvirtResource *resource_value = ovirt_resource_new_from_xml(type, node, NULL);
7de552
         g_value_set_object(value, resource_value);
7de552
@@ -210,6 +211,10 @@ _set_property_value_from_type(GValue *value,
7de552
         int enum_value = ovirt_utils_genum_get_value(type, value_str, enum_prop->default_value);
7de552
         g_value_set_enum(value, enum_value);
7de552
         goto end;
7de552
+    } else if (g_type_is_a(type, G_TYPE_BYTE_ARRAY)) {
7de552
+        GByteArray *array = g_byte_array_new_take((guchar *)g_strdup(value_str), strlen(value_str));
7de552
+        g_value_take_boxed(value, array);
7de552
+        goto end;
7de552
     }
7de552
 
7de552
     ret = _set_property_value_from_basic_type(value, type, value_str);
7de552
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c
7de552
index ebb04c2..a8a946a 100644
7de552
--- a/govirt/ovirt-vm-display.c
7de552
+++ b/govirt/ovirt-vm-display.c
7de552
@@ -336,6 +336,9 @@ static gboolean ovirt_vm_display_set_from_xml(OvirtVmDisplay *display, RestXmlNo
7de552
         { .prop_name = "proxy-url",
7de552
           .xml_path = "proxy",
7de552
         },
7de552
+        { .prop_name = "ca-cert",
7de552
+          .xml_path = "certificate/content",
7de552
+        },
7de552
         { NULL, },
7de552
     };
7de552
 
7de552
-- 
7de552
2.21.0
7de552