import libgovirt-0.3.4-9.el8

This commit is contained in:
CentOS Sources 2019-11-05 14:47:16 -05:00 committed by Andrew Lukoshko
parent 9c92ff994f
commit b20b4c0f20
16 changed files with 1387 additions and 1 deletions

View File

@ -0,0 +1,40 @@
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

View File

@ -0,0 +1,29 @@
From 5a41846ba6e0d88a0a641caa214703336e2b2820 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Mon, 18 Sep 2017 10:47:13 -0300
Subject: [PATCH] utils: Improve log message when subnode is not found
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index af1dfc6..a60c754 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -63,9 +63,10 @@ ovirt_rest_xml_node_find(RestXmlNode *node, const char *path)
pathv = g_strsplit(path, "/", -1);
for (i = 0; i < g_strv_length(pathv); ++i) {
+ gchar *name = node->name;
node = rest_xml_node_find(node, pathv[i]);
if (node == NULL) {
- g_debug("could not find XML node '%s'", pathv[i]);
+ g_debug("could not find subnode '%s' of XML node '%s' (search: %s)", pathv[i], name, path);
break;
}
}
--
2.14.4

View File

@ -0,0 +1,93 @@
From 1bff3d3ca4101639e659c8649731020e7a5c9c10 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Tue, 3 Oct 2017 17:32:03 -0300
Subject: [PATCH] utils: Factor out basic value type setting from
_set_property_value_from_type()
A simple cosmetic enhancement with the hope to improve code readability.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-utils.c | 59 ++++++++++++++++++++++++++++++----------------------
1 file changed, 34 insertions(+), 25 deletions(-)
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index a60c754..a0146fd 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -134,6 +134,39 @@ ovirt_rest_xml_node_get_str_array_from_path(RestXmlNode *node, const char *path,
return (GStrv) g_array_free(array, FALSE);
}
+static gboolean
+_set_property_value_from_basic_type(GValue *value,
+ GType type,
+ const char *value_str)
+{
+ switch(type) {
+ case G_TYPE_BOOLEAN: {
+ gboolean bool_value = ovirt_utils_boolean_from_string(value_str);
+ g_value_set_boolean(value, bool_value);
+ return TRUE;
+ }
+ case G_TYPE_STRING: {
+ g_value_set_string(value, value_str);
+ return TRUE;
+ }
+ case G_TYPE_UINT: {
+ guint uint_value = strtoul(value_str, NULL, 0);
+ g_value_set_uint(value, uint_value);
+ return TRUE;
+ }
+ case G_TYPE_UINT64: {
+ guint64 int64_value = g_ascii_strtoull(value_str, NULL, 0);
+ g_value_set_uint64(value, int64_value);
+ return TRUE;
+ }
+ default: {
+ g_warning("Unexpected type '%s' with value '%s'", g_type_name(type), value_str);
+ }
+ }
+
+ return FALSE;
+}
+
static gboolean
_set_property_value_from_type(GValue *value,
GType type,
@@ -174,31 +207,7 @@ _set_property_value_from_type(GValue *value,
goto end;
}
- switch(type) {
- case G_TYPE_BOOLEAN: {
- gboolean bool_value = ovirt_utils_boolean_from_string(value_str);
- g_value_set_boolean(value, bool_value);
- break;
- }
- case G_TYPE_STRING: {
- 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);
- break;
- }
- default: {
- g_warning("Unexpected type '%s' with value '%s'", g_type_name(type), value_str);
- ret = FALSE;
- }
- }
+ ret = _set_property_value_from_basic_type(value, type, value_str);
end:
return ret;
--
2.14.4

View File

@ -0,0 +1,55 @@
From 290692dcf6d572e86a2a90ff87f666ea148eb602 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Tue, 3 Oct 2017 17:51:41 -0300
Subject: [PATCH] utils: Get enum default value from GParamSpec
Instead of assuming 0 as the default value, use the one specified during
property creation time with g_param_spec_enum().
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-utils.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index a0146fd..dfaf09d 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -169,13 +169,14 @@ _set_property_value_from_basic_type(GValue *value,
static gboolean
_set_property_value_from_type(GValue *value,
- GType type,
+ GParamSpec *prop,
const char *path,
const char *attr,
RestXmlNode *node)
{
gboolean ret = TRUE;
const char *value_str;
+ GType type = prop->value_type;
if (g_type_is_a(type, OVIRT_TYPE_RESOURCE)) {
OvirtResource *resource_value = ovirt_resource_new_from_xml(type, node, NULL);
@@ -202,7 +203,8 @@ _set_property_value_from_type(GValue *value,
return FALSE;
if (G_TYPE_IS_ENUM(type)) {
- int enum_value = ovirt_utils_genum_get_value(type, value_str, 0);
+ GParamSpecEnum *enum_prop = G_PARAM_SPEC_ENUM(prop);
+ int enum_value = ovirt_utils_genum_get_value(type, value_str, enum_prop->default_value);
g_value_set_enum(value, enum_value);
goto end;
}
@@ -229,7 +231,7 @@ ovirt_rest_xml_node_parse(RestXmlNode *node,
g_return_val_if_fail(prop != NULL, FALSE);
g_value_init(&value, prop->value_type);
- if (_set_property_value_from_type(&value, prop->value_type, elements->xml_path, elements->xml_attr, node))
+ if (_set_property_value_from_type(&value, prop, elements->xml_path, elements->xml_attr, node))
g_object_set_property(object, elements->prop_name, &value);
g_value_unset(&value);
}
--
2.14.4

View File

@ -0,0 +1,82 @@
From 039c8d8bc0aa49ea3bd34fc190afc844d68a6e41 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Thu, 4 May 2017 18:23:39 -0300
Subject: [PATCH] vm: Set vm state property using OvirtXmlElement struct
It was required to change the default value of the enum property to
OVIRT_VM_STATE_UNKNOWN, so that it will be set by
ovirt_rest_xml_node_parse() function in case of error.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-vm-xml.c | 30 +-----------------------------
govirt/ovirt-vm.c | 5 ++++-
2 files changed, 5 insertions(+), 30 deletions(-)
diff --git a/govirt/ovirt-vm-xml.c b/govirt/ovirt-vm-xml.c
index 9990262..25f50f3 100644
--- a/govirt/ovirt-vm-xml.c
+++ b/govirt/ovirt-vm-xml.c
@@ -138,35 +138,7 @@ static gboolean vm_set_display_from_xml(OvirtVm *vm,
return TRUE;
}
-static gboolean vm_set_state_from_xml(OvirtVm *vm, RestXmlNode *node)
-{
- RestXmlNode *state_node;
-
- state_node = rest_xml_node_find(node, "status");
- if (state_node == NULL) {
- g_debug("Could not find 'status' node");
- return FALSE;
- }
- state_node = rest_xml_node_find(state_node, "state");
- if (state_node != NULL) {
- int state;
-
- g_return_val_if_fail(state_node->content != NULL, FALSE);
- state = ovirt_utils_genum_get_value(OVIRT_TYPE_VM_STATE,
- state_node->content,
- OVIRT_VM_STATE_UNKNOWN);
- g_object_set(G_OBJECT(vm), "state", state, NULL);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
G_GNUC_INTERNAL gboolean ovirt_vm_refresh_from_xml(OvirtVm *vm, RestXmlNode *node)
{
- vm_set_state_from_xml(vm, node);
- vm_set_display_from_xml(vm, node);
-
- return TRUE;
+ return vm_set_display_from_xml(vm, node);
}
diff --git a/govirt/ovirt-vm.c b/govirt/ovirt-vm.c
index 36ffd35..f30022d 100644
--- a/govirt/ovirt-vm.c
+++ b/govirt/ovirt-vm.c
@@ -199,6 +199,9 @@ static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
.xml_path = "cluster",
.xml_attr = "id",
},
+ { .prop_name = "state",
+ .xml_path = "status/state",
+ },
{ NULL, },
};
@@ -233,7 +236,7 @@ static void ovirt_vm_class_init(OvirtVmClass *klass)
"State",
"Virtual Machine State",
OVIRT_TYPE_VM_STATE,
- OVIRT_VM_STATE_DOWN,
+ OVIRT_VM_STATE_UNKNOWN,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
--
2.14.4

View File

@ -0,0 +1,190 @@
From b8b0d03e43bee40ad15fa4c3aa6ca8b07ca98e31 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Wed, 10 May 2017 15:48:09 -0300
Subject: [PATCH] vm: Set values of OvirtVmDisplay using OvirtXmlElement struct
This required the addition of OVIRT_VM_DISPLAY_INVALID to the
OvirtVmDisplayType enum as the default value.
The value of the 'type' property of OvirtVmDisplay is tested after the
parsing is done, to ensure it is either vnc or spice.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-vm-display.c | 2 +-
govirt/ovirt-vm-display.h | 3 +-
govirt/ovirt-vm-xml.c | 118 ++++++++++++++--------------------------------
3 files changed, 38 insertions(+), 85 deletions(-)
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c
index 37e042a..b03c303 100644
--- a/govirt/ovirt-vm-display.c
+++ b/govirt/ovirt-vm-display.c
@@ -197,7 +197,7 @@ static void ovirt_vm_display_class_init(OvirtVmDisplayClass *klass)
"Type",
"Display Type",
OVIRT_TYPE_VM_DISPLAY_TYPE,
- OVIRT_VM_DISPLAY_SPICE,
+ OVIRT_VM_DISPLAY_INVALID,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
diff --git a/govirt/ovirt-vm-display.h b/govirt/ovirt-vm-display.h
index f7eb310..38ef9b7 100644
--- a/govirt/ovirt-vm-display.h
+++ b/govirt/ovirt-vm-display.h
@@ -55,7 +55,8 @@ struct _OvirtVmDisplayClass
typedef enum {
OVIRT_VM_DISPLAY_SPICE,
- OVIRT_VM_DISPLAY_VNC
+ OVIRT_VM_DISPLAY_VNC,
+ OVIRT_VM_DISPLAY_INVALID,
} OvirtVmDisplayType;
GType ovirt_vm_display_get_type(void);
diff --git a/govirt/ovirt-vm-xml.c b/govirt/ovirt-vm-xml.c
index 25f50f3..0603427 100644
--- a/govirt/ovirt-vm-xml.c
+++ b/govirt/ovirt-vm-xml.c
@@ -33,102 +33,54 @@
static gboolean vm_set_display_from_xml(OvirtVm *vm,
RestXmlNode *root)
{
- RestXmlNode *node;
OvirtVmDisplay *display;
- const char *display_key = g_intern_string("display");
- const char *type_key = g_intern_string("type");
- const char *address_key = g_intern_string("address");
- const char *port_key = g_intern_string("port");
- const char *secure_port_key = g_intern_string("secure_port");
- const char *monitors_key = g_intern_string("monitors");
- const char *certificate_key = g_intern_string("certificate");
- const char *smartcard_key = g_intern_string("smartcard_enabled");
- const char *allow_override_key = g_intern_string("allow_override");
- const char *proxy_key = g_intern_string("proxy");
+ OvirtVmDisplayType type;
+ OvirtXmlElement display_elements[] = {
+ { .prop_name = "type",
+ .xml_path = "type",
+ },
+ { .prop_name = "address",
+ .xml_path = "address",
+ },
+ { .prop_name = "port",
+ .xml_path = "port",
+ },
+ { .prop_name = "secure-port",
+ .xml_path = "secure_port",
+ },
+ { .prop_name = "monitor-count",
+ .xml_path = "monitors",
+ },
+ { .prop_name = "smartcard",
+ .xml_path = "smartcard_enabled",
+ },
+ { .prop_name = "allow-override",
+ .xml_path = "allow_override",
+ },
+ { .prop_name = "host-subject",
+ .xml_path = "certificate/subject",
+ },
+ { .prop_name = "proxy-url",
+ .xml_path = "proxy",
+ },
+ { NULL, },
+ };
if (root == NULL) {
return FALSE;
}
- root = g_hash_table_lookup(root->children, display_key);
+ root = rest_xml_node_find(root, "display");
if (root == NULL) {
g_debug("Could not find 'display' node");
return FALSE;
}
display = ovirt_vm_display_new();
-
- node = g_hash_table_lookup(root->children, type_key);
- g_return_val_if_fail(node != NULL, FALSE);
- if (g_strcmp0(node->content, "spice") == 0) {
- g_object_set(G_OBJECT(display), "type", OVIRT_VM_DISPLAY_SPICE, NULL);
- } else if (g_strcmp0(node->content, "vnc") == 0) {
- g_object_set(G_OBJECT(display), "type", OVIRT_VM_DISPLAY_VNC, NULL);
- } else {
- g_warning("Unknown display type: %s", node->content);
+ ovirt_rest_xml_node_parse(root, G_OBJECT(display), display_elements);
+ g_object_get(G_OBJECT(display), "type", &type, NULL);
+ if (type == OVIRT_VM_DISPLAY_INVALID) {
return FALSE;
}
- node = g_hash_table_lookup(root->children, monitors_key);
- g_return_val_if_fail(node != NULL, FALSE);
- g_object_set(G_OBJECT(display),
- "monitor-count", strtoul(node->content, NULL, 0),
- NULL);
-
- /* on non started VMs, these 2 values will not be available */
- node = g_hash_table_lookup(root->children, address_key);
- if (node != NULL) {
- g_object_set(G_OBJECT(display), "address", node->content, NULL);
- }
-
- node = g_hash_table_lookup(root->children, port_key);
- if (node != NULL) {
- g_object_set(G_OBJECT(display),
- "port", strtoul(node->content, NULL, 0),
- NULL);
- }
-
- node = g_hash_table_lookup(root->children, secure_port_key);
- if (node != NULL) {
- g_object_set(G_OBJECT(display),
- "secure-port", strtoul(node->content, NULL, 0),
- NULL);
- }
-
- node = g_hash_table_lookup(root->children, smartcard_key);
- if (node != NULL) {
- gboolean smartcard;
-
- smartcard = (g_strcmp0(node->content, "true") == 0);
- g_object_set(G_OBJECT(display),
- "smartcard", smartcard,
- NULL);
- }
-
- node = g_hash_table_lookup(root->children, allow_override_key);
- if (node != NULL) {
- gboolean allow_override;
-
- allow_override = (g_strcmp0(node->content, "true") == 0);
- g_object_set(G_OBJECT(display),
- "allow-override", allow_override,
- NULL);
- }
-
- node = g_hash_table_lookup(root->children, certificate_key);
- if (node != NULL) {
- const char *subject_key = g_intern_string("subject");
- node = g_hash_table_lookup(node->children, subject_key);
- if (node != NULL) {
- g_object_set(G_OBJECT(display),
- "host-subject", node->content,
- NULL);
- }
- }
-
- node = g_hash_table_lookup(root->children, proxy_key);
- if (node != NULL) {
- g_object_set(G_OBJECT(display), "proxy-url", node->content, NULL);
- }
-
/* FIXME: this overrides the ticket/expiry which may
* already be set
*/
--
2.14.4

View File

@ -0,0 +1,266 @@
From c81f18b9dd4888145ac979addb4ef5d73585a176 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Tue, 19 Sep 2017 12:02:32 -0300
Subject: [PATCH] vm-display: Move XML parsing from ovirt-vm-xml.c file
Following the model of other resources, the code for parsing the XML
elements for the OvirtVmDisplay object where it really belongs to.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/Makefile.am | 1 -
govirt/ovirt-vm-display.c | 60 +++++++++++++++++++++++++++++
govirt/ovirt-vm-display.h | 2 +
govirt/ovirt-vm-xml.c | 96 -----------------------------------------------
govirt/ovirt-vm.c | 15 ++++++--
5 files changed, 74 insertions(+), 100 deletions(-)
delete mode 100644 govirt/ovirt-vm-xml.c
diff --git a/govirt/Makefile.am b/govirt/Makefile.am
index 9bf0eba..1a59f2c 100644
--- a/govirt/Makefile.am
+++ b/govirt/Makefile.am
@@ -73,7 +73,6 @@ libgovirt_la_SOURCES = \
ovirt-utils.c \
ovirt-vm.c \
ovirt-vm-display.c \
- ovirt-vm-xml.c \
ovirt-vm-pool.c \
$(NULL)
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c
index b03c303..ebb04c2 100644
--- a/govirt/ovirt-vm-display.c
+++ b/govirt/ovirt-vm-display.c
@@ -24,6 +24,7 @@
#include "ovirt-enum-types.h"
#include "ovirt-vm-display.h"
+#include "ovirt-utils.h"
#define OVIRT_VM_DISPLAY_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_VM_DISPLAY, OvirtVmDisplayPrivate))
@@ -303,3 +304,62 @@ OvirtVmDisplay *ovirt_vm_display_new(void)
{
return OVIRT_VM_DISPLAY(g_object_new(OVIRT_TYPE_VM_DISPLAY, NULL));
}
+
+static gboolean ovirt_vm_display_set_from_xml(OvirtVmDisplay *display, RestXmlNode *node)
+{
+ OvirtVmDisplayType type;
+ OvirtXmlElement display_elements[] = {
+ { .prop_name = "type",
+ .xml_path = "type",
+ },
+ { .prop_name = "address",
+ .xml_path = "address",
+ },
+ { .prop_name = "port",
+ .xml_path = "port",
+ },
+ { .prop_name = "secure-port",
+ .xml_path = "secure_port",
+ },
+ { .prop_name = "monitor-count",
+ .xml_path = "monitors",
+ },
+ { .prop_name = "smartcard",
+ .xml_path = "smartcard_enabled",
+ },
+ { .prop_name = "allow-override",
+ .xml_path = "allow_override",
+ },
+ { .prop_name = "host-subject",
+ .xml_path = "certificate/subject",
+ },
+ { .prop_name = "proxy-url",
+ .xml_path = "proxy",
+ },
+ { NULL, },
+ };
+
+ ovirt_rest_xml_node_parse(node, G_OBJECT(display), display_elements);
+ g_object_get(G_OBJECT(display), "type", &type, NULL);
+ if (type == OVIRT_VM_DISPLAY_INVALID) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+OvirtVmDisplay *ovirt_vm_display_new_from_xml(RestXmlNode *node)
+{
+ OvirtVmDisplay *display;
+
+ g_return_val_if_fail(node != NULL, NULL);
+
+ display = ovirt_vm_display_new();
+
+ if (!ovirt_vm_display_set_from_xml(display, node)) {
+ g_object_unref(display);
+ return NULL;
+ }
+
+ return display;
+}
diff --git a/govirt/ovirt-vm-display.h b/govirt/ovirt-vm-display.h
index 38ef9b7..11a5074 100644
--- a/govirt/ovirt-vm-display.h
+++ b/govirt/ovirt-vm-display.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
#include <govirt/ovirt-types.h>
+#include <rest/rest-xml-node.h>
G_BEGIN_DECLS
@@ -61,6 +62,7 @@ typedef enum {
GType ovirt_vm_display_get_type(void);
OvirtVmDisplay *ovirt_vm_display_new(void);
+OvirtVmDisplay *ovirt_vm_display_new_from_xml(RestXmlNode *node);
G_END_DECLS
diff --git a/govirt/ovirt-vm-xml.c b/govirt/ovirt-vm-xml.c
deleted file mode 100644
index 0603427..0000000
--- a/govirt/ovirt-vm-xml.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ovirt-vm-xml.c
- *
- * Copyright (C) 2011, 2013 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * Author: Christophe Fergeau <cfergeau@redhat.com>
- */
-#include <config.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "ovirt-enum-types.h"
-#include "ovirt-utils.h"
-#include "ovirt-vm.h"
-#include "ovirt-vm-display.h"
-#include "ovirt-vm-private.h"
-
-static gboolean vm_set_display_from_xml(OvirtVm *vm,
- RestXmlNode *root)
-{
- OvirtVmDisplay *display;
- OvirtVmDisplayType type;
- OvirtXmlElement display_elements[] = {
- { .prop_name = "type",
- .xml_path = "type",
- },
- { .prop_name = "address",
- .xml_path = "address",
- },
- { .prop_name = "port",
- .xml_path = "port",
- },
- { .prop_name = "secure-port",
- .xml_path = "secure_port",
- },
- { .prop_name = "monitor-count",
- .xml_path = "monitors",
- },
- { .prop_name = "smartcard",
- .xml_path = "smartcard_enabled",
- },
- { .prop_name = "allow-override",
- .xml_path = "allow_override",
- },
- { .prop_name = "host-subject",
- .xml_path = "certificate/subject",
- },
- { .prop_name = "proxy-url",
- .xml_path = "proxy",
- },
- { NULL, },
- };
-
- if (root == NULL) {
- return FALSE;
- }
- root = rest_xml_node_find(root, "display");
- if (root == NULL) {
- g_debug("Could not find 'display' node");
- return FALSE;
- }
- display = ovirt_vm_display_new();
- ovirt_rest_xml_node_parse(root, G_OBJECT(display), display_elements);
- g_object_get(G_OBJECT(display), "type", &type, NULL);
- if (type == OVIRT_VM_DISPLAY_INVALID) {
- return FALSE;
- }
-
- /* FIXME: this overrides the ticket/expiry which may
- * already be set
- */
- g_object_set(G_OBJECT(vm), "display", display, NULL);
- g_object_unref(G_OBJECT(display));
-
- return TRUE;
-}
-
-G_GNUC_INTERNAL gboolean ovirt_vm_refresh_from_xml(OvirtVm *vm, RestXmlNode *node)
-{
- return vm_set_display_from_xml(vm, node);
-}
diff --git a/govirt/ovirt-vm.c b/govirt/ovirt-vm.c
index f30022d..95c1e4d 100644
--- a/govirt/ovirt-vm.c
+++ b/govirt/ovirt-vm.c
@@ -180,7 +180,8 @@ static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
- gboolean parsed_ok;
+ OvirtVmDisplay *display;
+ RestXmlNode *display_node;
OvirtResourceClass *parent_class;
OvirtXmlElement vm_elements[] = {
{ .prop_name = "host-href",
@@ -205,11 +206,19 @@ static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
{ NULL, },
};
- parsed_ok = ovirt_vm_refresh_from_xml(OVIRT_VM(resource), node);
- if (!parsed_ok) {
+ display_node = rest_xml_node_find(node, "display");
+ if (display_node == NULL) {
+ g_debug("Could not find 'display' node");
return FALSE;
}
+ display = ovirt_vm_display_new_from_xml(display_node);
+ if (display == NULL)
+ return FALSE;
+
+ g_object_set(G_OBJECT(resource), "display", display, NULL);
+ g_object_unref(G_OBJECT(display));
+
if (!ovirt_rest_xml_node_parse(node, G_OBJECT(resource), vm_elements))
return FALSE;
--
2.14.4

View File

@ -0,0 +1,98 @@
From 3a92d61ba92b85c0d31aa836713344085dab813e Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Wed, 10 May 2017 15:16:27 -0300
Subject: [PATCH] vm: Set 'ticket/expiry' using OvirtXmlElement struct
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-vm.c | 56 +++++++++++++++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 24 deletions(-)
diff --git a/govirt/ovirt-vm.c b/govirt/ovirt-vm.c
index 95c1e4d..8cd482b 100644
--- a/govirt/ovirt-vm.c
+++ b/govirt/ovirt-vm.c
@@ -381,48 +381,56 @@ gboolean ovirt_vm_stop(OvirtVm *vm, OvirtProxy *proxy, GError **error)
static gboolean parse_ticket_status(RestXmlNode *root, OvirtResource *resource, GError **error)
{
- OvirtVm *vm;
- RestXmlNode *node;
- const char *ticket_key = g_intern_string("ticket");
- const char *value_key = g_intern_string("value");
- const char *expiry_key = g_intern_string("expiry");
OvirtVmDisplay *display;
+ gchar *ticket = NULL;
+ guint expiry = 0;
+ gboolean ret = FALSE;
+ OvirtXmlElement ticket_elements[] = {
+ { .prop_name = "ticket",
+ .xml_path = "value",
+ },
+ { .prop_name = "expiry",
+ .xml_path = "expiry",
+ },
+ { NULL, },
+ };
g_return_val_if_fail(root != NULL, FALSE);
g_return_val_if_fail(OVIRT_IS_VM(resource), FALSE);
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
- vm = OVIRT_VM(resource);
- root = g_hash_table_lookup(root->children, ticket_key);
+ g_object_get(G_OBJECT(resource), "display", &display, NULL);
+ g_return_val_if_fail(display != NULL, FALSE);
+
+ root = rest_xml_node_find(root, "ticket");
if (root == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'ticket' node"));
- g_return_val_if_reached(FALSE);
+ goto end;
}
- node = g_hash_table_lookup(root->children, value_key);
- if (node == NULL) {
+
+ ovirt_rest_xml_node_parse(root, G_OBJECT(display), ticket_elements);
+
+ g_object_get(G_OBJECT(display), "ticket", &ticket, "expiry", &expiry, NULL);
+
+ if (ticket == NULL) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'value' node"));
- g_return_val_if_reached(FALSE);
+ goto end;
}
+ g_free(ticket);
- g_object_get(G_OBJECT(vm), "display", &display, NULL);
- g_return_val_if_fail(display != NULL, FALSE);
- g_object_set(G_OBJECT(display), "ticket", node->content, NULL);
-
- node = g_hash_table_lookup(root->children, expiry_key);
- if (node == NULL) {
+ if (expiry == 0) {
g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
_("Could not find 'expiry' node"));
- g_object_unref(G_OBJECT(display));
- g_return_val_if_reached(FALSE);
+ goto end;
}
- g_object_set(G_OBJECT(display),
- "expiry", strtoul(node->content, NULL, 0),
- NULL);
+
+ ret = TRUE;
+
+end:
g_object_unref(G_OBJECT(display));
-
- return TRUE;
+ return ret;
}
--
2.14.4

View File

@ -0,0 +1,39 @@
From a2abf332bf99baf1d6b6a96d9153b44efdedf384 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Fri, 22 Jun 2018 18:18:53 -0300
Subject: [PATCH] test-govirt: Add 'display' node to vm XMLs
Makes 'make distcheck' pass again. Test-govirt was failing since commit
039c8d8, because the 'display' node is mandatory, but the return value
of the function vm_set_display_from_xml() had been ignored.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
tests/test-govirt.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/test-govirt.c b/tests/test-govirt.c
index 247a27a..7f2cd57 100644
--- a/tests/test-govirt.c
+++ b/tests/test-govirt.c
@@ -194,9 +194,17 @@ static void test_govirt_list_duplicate_vms(void)
const char *vms_body = "<vms> \
<vm href=\"api/vms/uuid0\" id=\"uuid0\"> \
<name>vm0</name> \
+ <display> \
+ <type>spice</type> \
+ <monitors>1</monitors> \
+ </display> \
</vm> \
<vm href=\"api/vms/uuid1\" id=\"uuid1\"> \
<name>vm0</name> \
+ <display> \
+ <type>spice</type> \
+ <monitors>1</monitors> \
+ </display> \
</vm> \
</vms>";
--
2.14.4

View File

@ -0,0 +1,66 @@
From 01563a00550dd001f080aeddd8c6bbc35c676991 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Wed, 11 Jul 2018 15:42:16 -0300
Subject: [PATCH] proxy: Set detailed error message for async call
The rest API returns more detailed error messages with the result, not
only the literal corresponding to the value. If this is the case, we set
a new error message and return it.
For example, before this change, virt-viewer showed a dialog with a
vague 'Bad Request' message, and now a much more detailed 'Operation
Failed: query execution failed due to insufficient permissions.'
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-proxy.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 921e22e..f8e629e 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -240,6 +240,22 @@ call_async_cancelled_cb (G_GNUC_UNUSED GCancellable *cancellable,
}
+static void rest_call_async_set_error(RestProxyCall *call, GSimpleAsyncResult *result, const GError *error)
+{
+ GError *local_error = NULL;
+ RestXmlNode *root = ovirt_rest_xml_node_from_call(call);
+
+ if (root != NULL && ovirt_utils_gerror_from_xml_fault(root, &local_error)) {
+ g_debug("ovirt_rest_call_async(): %s", local_error->message);
+ g_simple_async_result_set_from_error(result, local_error);
+ g_clear_error(&local_error);
+ } else {
+ g_simple_async_result_set_from_error(result, error);
+ }
+
+ rest_xml_node_unref(root);
+}
+
static void
call_async_cb(RestProxyCall *call, const GError *error,
G_GNUC_UNUSED GObject *weak_object,
@@ -249,7 +265,7 @@ call_async_cb(RestProxyCall *call, const GError *error,
GSimpleAsyncResult *result = data->result;
if (error != NULL) {
- g_simple_async_result_set_from_error(result, error);
+ rest_call_async_set_error(call, result, error);
} else {
GError *call_error = NULL;
gboolean callback_result = TRUE;
@@ -259,7 +275,7 @@ call_async_cb(RestProxyCall *call, const GError *error,
data->call_user_data,
&call_error);
if (call_error != NULL) {
- g_simple_async_result_set_from_error(result, call_error);
+ rest_call_async_set_error(call, result, call_error);
}
}
--
2.20.1

View File

@ -0,0 +1,108 @@
From 53fb63d610503679bd3f4e2780989076544ddb14 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Thu, 4 May 2017 15:54:02 -0300
Subject: [PATCH] cdrom: Set file property using OvirtXmlElement struct
This was the last place left to move to the new automatic parsing
scheme.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-cdrom.c | 57 +++++++++++++++++---------------------------
1 file changed, 22 insertions(+), 35 deletions(-)
diff --git a/govirt/ovirt-cdrom.c b/govirt/ovirt-cdrom.c
index d852403..5bab7d3 100644
--- a/govirt/ovirt-cdrom.c
+++ b/govirt/ovirt-cdrom.c
@@ -28,6 +28,7 @@
#include "ovirt-proxy-private.h"
#include "ovirt-resource-private.h"
#include "ovirt-resource-rest-call.h"
+#include "ovirt-utils.h"
#define OVIRT_CDROM_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), OVIRT_TYPE_CDROM, OvirtCdromPrivate))
@@ -95,25 +96,29 @@ static void ovirt_cdrom_finalize(GObject *object)
}
-static gboolean ovirt_cdrom_refresh_from_xml(OvirtCdrom *cdrom,
- RestXmlNode *node)
+static gboolean ovirt_cdrom_init_from_xml(OvirtResource *resource,
+ RestXmlNode *node,
+ GError **error)
{
- RestXmlNode *file_node;
- const char *file;
- const char *file_key = g_intern_string("file");
+ gboolean ret = FALSE;
char *name;
+ OvirtResourceClass *parent_class;
+ OvirtXmlElement cdrom_elements[] = {
+ { .prop_name = "file",
+ .xml_path = "file",
+ .xml_attr = "id",
+ },
+ { NULL , },
+ };
- file_node = g_hash_table_lookup(node->children, file_key);
- if (file_node != NULL) {
- file = rest_xml_node_get_attr(file_node, "id");
- if (g_strcmp0(file, cdrom->priv->file) != 0) {
- g_free(cdrom->priv->file);
- cdrom->priv->file = g_strdup(file);
- g_object_notify(G_OBJECT(cdrom), "file");
- }
- }
+ parent_class = OVIRT_RESOURCE_CLASS(ovirt_cdrom_parent_class);
+
+ if (!parent_class->init_from_xml(resource, node, error))
+ return FALSE;
- g_object_get(G_OBJECT(cdrom), "name", &name, NULL);
+ ovirt_rest_xml_node_parse(node, G_OBJECT(resource), cdrom_elements);
+
+ g_object_get(G_OBJECT(resource), "name", &name, NULL);
if (name == NULL) {
/* Build up fake name as ovirt_collection_refresh_from_xml()
* expects it to be set (it uses it as a hash table key), but
@@ -122,32 +127,14 @@ static gboolean ovirt_cdrom_refresh_from_xml(OvirtCdrom *cdrom,
* enough for now
*/
g_debug("Setting fake 'name' for cdrom resource");
- g_object_set(G_OBJECT(cdrom), "name", "cdrom0", NULL);
- } else {
- g_free(name);
+ g_object_set(G_OBJECT(resource), "name", "cdrom0", NULL);
}
+ g_free(name);
return TRUE;
}
-static gboolean ovirt_cdrom_init_from_xml(OvirtResource *resource,
- RestXmlNode *node,
- GError **error)
-{
- gboolean parsed_ok;
- OvirtResourceClass *parent_class;
-
- parsed_ok = ovirt_cdrom_refresh_from_xml(OVIRT_CDROM(resource), node);
- if (!parsed_ok) {
- return FALSE;
- }
- parent_class = OVIRT_RESOURCE_CLASS(ovirt_cdrom_parent_class);
-
- return parent_class->init_from_xml(resource, node, error);
-}
-
-
static char *ovirt_cdrom_to_xml(OvirtResource *resource)
{
OvirtCdrom *cdrom;
--
2.20.1

View File

@ -0,0 +1,31 @@
From 8032575cbe274c9e70ec2a0efb0b536f13dbc6cd Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Fri, 21 Dec 2018 13:15:16 +0100
Subject: [PATCH] proxy: Don't try to unref NULL root node
When an error occurs, we may have failed to get any data, so 'root' may
be NULL. Trying to unref it triggers a critical. This happens for
example when trying to connect to a remote host with an invalid
certificate.
---
govirt/ovirt-proxy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index f8e629e..920ef21 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -253,7 +253,9 @@ static void rest_call_async_set_error(RestProxyCall *call, GSimpleAsyncResult *r
g_simple_async_result_set_from_error(result, error);
}
- rest_xml_node_unref(root);
+ if (root != NULL) {
+ rest_xml_node_unref(root);
+ }
}
static void
--
2.20.1

View File

@ -0,0 +1,98 @@
From d6ddeff795ce3f132f1e266fc813e0a4917f8bf7 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Mon, 4 Feb 2019 15:58:40 -0200
Subject: [PATCH] utils: Check for valid data before calling
rest_xml_parser_parse_from_data()
In the case of HTTP errors, such as a invalid TLS certificate, the
returned data is NULL, and the code in librest does not check for the
pointer being valid, causing a segfault.
The users of this function have been updated to check for NULL return
value.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-proxy.c | 6 ++++++
govirt/ovirt-resource.c | 9 ++++++++-
govirt/ovirt-utils.c | 7 +++++--
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
index 920ef21..9cdd211 100644
--- a/govirt/ovirt-proxy.c
+++ b/govirt/ovirt-proxy.c
@@ -365,6 +365,11 @@ static gboolean get_collection_xml_async_cb(OvirtProxy* proxy,
data = (OvirtProxyGetCollectionAsyncData *)user_data;
root = ovirt_rest_xml_node_from_call(call);
+ if (root == NULL) {
+ g_set_error_literal(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
+ _("Failed to parse response from collection"));
+ goto end;
+ }
/* Do the parsing */
g_warn_if_fail(data->parser != NULL);
@@ -374,6 +379,7 @@ static gboolean get_collection_xml_async_cb(OvirtProxy* proxy,
rest_xml_node_unref(root);
+end:
return parsed;
}
diff --git a/govirt/ovirt-resource.c b/govirt/ovirt-resource.c
index 1984b1d..936e912 100644
--- a/govirt/ovirt-resource.c
+++ b/govirt/ovirt-resource.c
@@ -868,17 +868,24 @@ static gboolean ovirt_resource_refresh_async_cb(OvirtProxy *proxy,
{
OvirtResource *resource;
RestXmlNode *root;
- gboolean refreshed;
+ gboolean refreshed = FALSE;
g_return_val_if_fail(REST_IS_PROXY_CALL(call), FALSE);
g_return_val_if_fail(OVIRT_IS_RESOURCE(user_data), FALSE);
root = ovirt_rest_xml_node_from_call(call);
+ if (root == NULL) {
+ g_set_error_literal(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
+ _("Failed to parse response from resource"));
+ goto end;
+ }
+
resource = OVIRT_RESOURCE(user_data);
refreshed = ovirt_resource_init_from_xml(resource, root, error);
rest_xml_node_unref(root);
+end:
return refreshed;
}
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index dfaf09d..56ce2e1 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -40,11 +40,14 @@ ovirt_rest_xml_node_from_call(RestProxyCall *call)
{
RestXmlParser *parser;
RestXmlNode *node;
+ const char * data = rest_proxy_call_get_payload (call);
+
+ if (data == NULL)
+ return NULL;
parser = rest_xml_parser_new ();
- node = rest_xml_parser_parse_from_data (parser,
- rest_proxy_call_get_payload (call),
+ node = rest_xml_parser_parse_from_data (parser, data,
rest_proxy_call_get_payload_length (call));
g_object_unref(G_OBJECT(parser));
--
2.20.1

View File

@ -0,0 +1,147 @@
From d8b4c483d8e31525b1290115fbded054b4e8c3ab Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Tue, 21 May 2019 14:30:50 -0300
Subject: [PATCH] Update tests certificates
As reference, use https://www.spice-space.org/spice-user-manual.html#_generating_self_signed_certificates
in order to create new certificates. This procedure should not be
necessary anymore, current date of expiration is set to Dec 31st 9999.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
tests/https-cert/ca-cert.pem | 60 ++++++++++++++++----------------
tests/https-cert/server-cert.pem | 54 ++++++++++++++--------------
2 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/tests/https-cert/ca-cert.pem b/tests/https-cert/ca-cert.pem
index 1f37f35..b904a2d 100644
--- a/tests/https-cert/ca-cert.pem
+++ b/tests/https-cert/ca-cert.pem
@@ -1,32 +1,32 @@
-----BEGIN CERTIFICATE-----
-MIIFfzCCA2egAwIBAgIJAJe68wcZuCytMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV
-BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg
-Q29tcGFueSBMdGQxEjAQBgNVBAMMCWdvdmlydCBDQTAeFw0xNjA0MTIxNTEyNDFa
-Fw0xOTA0MTIxNTEyNDFaMFYxCzAJBgNVBAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0
-IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdG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CBqv7fQnSPOBgvQ/5OwribIHLuvjCVF0BkI3u+NeNVSzFtGreFHNWJ6foA6o
+Um50pw/hCgLptOfhXYkCx2uP7XxOhjlpJOc+1I05Y44vai5YmpqwvvEWkcV2Dlw3
+ihIHWca6wxVql61LqIzqoiVxNhGiOGTPWbyGMBWA+8cbxVqG0zBKl3A4vox0cGRX
+QPBIiUFjhx4Z5pYZuJ5ndQHiclnYtEfC6+UppL08yrDdIzyLMxIpDqkUAw03TKKC
+TzCsa3DL10LTIulDJurC5SHgY+SrBrWAGuSy97Lmp0cogSBgU9VFqESKaB1lgtET
+c8dkOFwHdOIXu3iI9uKGcwkUfrjGsUdYOUJaAJ5t36WCw/Q=
-----END CERTIFICATE-----
diff --git a/tests/https-cert/server-cert.pem b/tests/https-cert/server-cert.pem
index 709369f..9ca912d 100644
--- a/tests/https-cert/server-cert.pem
+++ b/tests/https-cert/server-cert.pem
@@ -1,30 +1,30 @@
-----BEGIN CERTIFICATE-----
-MIIFIDCCAwgCAQEwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCWFgxFTATBgNV
+MIIFIjCCAwoCAQEwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCWFgxFTATBgNV
BAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDES
-MBAGA1UEAwwJZ292aXJ0IENBMB4XDTE2MDQxMjE1MTMzNVoXDTE5MDQxMjE1MTMz
-NVowVjELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UE
-CgwTRGVmYXVsdCBDb21wYW55IEx0ZDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjAN
-BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAt6OkS5HhwwFLJWDmuRSOYCXwQP6v
-OlToc7rHvK0+shkspUb1KYks3iEw9djLQdxf1E5k+oDlifDKAMgd/AxkJn8kZ4f1
-i3183gFdad+UlMFwCliReb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nlcoWlZys/2tgdKXR3vS7piKgykgzZQKV9E9Cc
+u9f78ffIGyEA9CV0GCx5cn3OUbWGjl9doiDm7ia02D4Zxx6s04XKl0klz3sh1gWb
+KGbDD/otykwqT57rAQIDAQABMA0GCSqGSIb3DQEBCwUAA4ICAQCdarzrfXWzSL1k
+MZ+D25teNSgZglXw7cpc/WVx2zQ26Wd7csig8Gac1vW/bQMk9XBbwZoI9tuHk62l
+6+9eXGgIgN5qUCchlqcO41IVSk4sWrvNPXiU7kbLrjmrh8txQM8D/YLKm8S8Muf7
+F4r/RhRkQY+85eOS2GEyj5AMnUlmi1g7wBkIiRipY4fMLowwX8ouQiJCvQE/LJYS
+rQlPDnvCwcVmOxEKUjQoZ0vKrD6zNrnWzEe3LXxQQI3OnnAqgVGHH7bQsY482apn
+2e+WRJouBSwOKEb27/DWMQoXaiVhNBh2wWt5xgKKupJB+PIyW0H2w0Gw1Jr2JY+I
+Lh5fXJXCB/BF3qsbJhi2mnNYWhPP4oOoLN/pT6m1FV/bbTEXlsxxczfE/zT4JRsi
+DhQRZ/FWhbpT9Z7I5kd76KjpKkRFi3Nkb9ezAW35xuo6Ex5x7EWNJM8FJuktNgIK
+Z7JxnqeC0DVEDSWhtxo6HTlx0HgpVTjRPKCVEt1d4itPRBMKueygul1se1jLlMw8
++8sRpCxdYU9KX18c+p4wANTke94vH5mrm2msK/oXmM77VDIGriEtr8tMIYZbGwKQ
+dhUKsH9eaReKHwoLqihQotpEi28DSng4EXSu9crZV/Yu7crL1+JBSF+N5OK7cf0q
+8K2k/Y/pshicpfHaEKDJmLp5vfULNw==
-----END CERTIFICATE-----
--
2.21.0

View File

@ -0,0 +1,25 @@
From 6ffccbc63ec4617123e3a6cdb32d721658bc4f50 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Mon, 27 May 2019 09:45:01 -0300
Subject: [PATCH] cdrom: Remove unused variable
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
govirt/ovirt-cdrom.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/govirt/ovirt-cdrom.c b/govirt/ovirt-cdrom.c
index 5bab7d3..f625a0c 100644
--- a/govirt/ovirt-cdrom.c
+++ b/govirt/ovirt-cdrom.c
@@ -100,7 +100,6 @@ static gboolean ovirt_cdrom_init_from_xml(OvirtResource *resource,
RestXmlNode *node,
GError **error)
{
- gboolean ret = FALSE;
char *name;
OvirtResourceClass *parent_class;
OvirtXmlElement cdrom_elements[] = {
--
2.21.0

View File

@ -17,7 +17,7 @@
Summary: A GObject library for interacting with oVirt REST API
Name: libgovirt
Version: 0.3.4
Release: 8%{?dist}%{?extra_release}
Release: 9%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source0: http://ftp.gnome.org/pub/GNOME/sources/libgovirt/0.3/%{name}-%{version}.tar.xz
@ -56,6 +56,21 @@ Patch29: 0029-resource-Fix-ovirt_resource_rest_call_sync-crash-on-.patch
Patch30: 0030-resource-Fix-ovirt_resource_init_from_xml_real-preco.patch
Patch31: 0031-resource-Update-xml-node-in-ovirt_resource_init_from.patch
Patch32: 0032-utils-Drop-type-member-from-OvirtXmlElement-struct.patch
Patch33: 0033-utils-Support-G_TYPE_UINT-in-_set_property_value_fro.patch
Patch34: 0034-utils-Improve-log-message-when-subnode-is-not-found.patch
Patch35: 0035-utils-Factor-out-basic-value-type-setting-from-_set_.patch
Patch36: 0036-utils-Get-enum-default-value-from-GParamSpec.patch
Patch37: 0037-vm-Set-vm-state-property-using-OvirtXmlElement-struc.patch
Patch38: 0038-vm-Set-values-of-OvirtVmDisplay-using-OvirtXmlElemen.patch
Patch39: 0039-vm-display-Move-XML-parsing-from-ovirt-vm-xml.c-file.patch
Patch40: 0040-vm-Set-ticket-expiry-using-OvirtXmlElement-struct.patch
Patch41: 0041-test-govirt-Add-display-node-to-vm-XMLs.patch
Patch42: 0042-proxy-Set-detailed-error-message-for-async-call.patch
Patch43: 0043-cdrom-Set-file-property-using-OvirtXmlElement-struct.patch
Patch44: 0044-proxy-Don-t-try-to-unref-NULL-root-node.patch
Patch45: 0045-utils-Check-for-valid-data-before-calling-rest_xml_p.patch
Patch46: 0046-Update-tests-certificates.patch
Patch47: 0047-cdrom-Remove-unused-variable.patch
%if 0%{?enable_autotools}
BuildRequires: autoconf
@ -143,6 +158,10 @@ make check
%endif
%changelog
* Mon Aug 2 2019 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-9
- Sync with the rhel 7.7 package
Related: rhbz#1717900
* Mon Jun 11 2018 Christophe Fergeau <cfergeau@redhat.com> - 0.3.4-8
- Sync with the rhel 7.6 package
Resolves: rhbz#1584506