From 7eae90f67d00bf36c0a9c56cf3c9e4fdc7d02494 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Wed, 10 May 2017 15:53:12 -0300
Subject: [PATCH] utils: Support G_TYPE_UINT in _set_property_value_from_type()

This type will mostly be used to parse the XML elements for
OvirtVmDisplay.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
 govirt/ovirt-utils.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index 501acb9..af1dfc6 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -23,6 +23,7 @@
 #include <config.h>

 #include <errno.h>
+#include <stdlib.h>
 #include <string.h>

 #include <glib/gi18n-lib.h>
@@ -182,6 +183,11 @@ _set_property_value_from_type(GValue *value,
         g_value_set_string(value, value_str);
         break;
     }
+    case G_TYPE_UINT: {
+        guint uint_value = strtoul(value_str, NULL, 0);
+        g_value_set_uint(value, uint_value);
+        break;
+    }
     case G_TYPE_UINT64: {
         guint64 int64_value = g_ascii_strtoull(value_str, NULL, 0);
         g_value_set_uint64(value, int64_value);
--
2.14.4
