import libgovirt-0.3.4-12.el8_2
This commit is contained in:
parent
b20b4c0f20
commit
09f68a846b
@ -0,0 +1,56 @@
|
||||
From 0fceae5b08888ae04d0f984aaa2583ca39756880 Mon Sep 17 00:00:00 2001
|
||||
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||
Date: Thu, 3 Oct 2019 15:30:46 -0300
|
||||
Subject: [PATCH] vm-display: Add support for parsing certificate data
|
||||
|
||||
Certificate data is stored as GByteArray, thus requiring support for
|
||||
G_TYPE_BYTE_ARRAY in ovirt-utils.
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1402909
|
||||
|
||||
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
||||
---
|
||||
govirt/ovirt-utils.c | 5 +++++
|
||||
govirt/ovirt-vm-display.c | 3 +++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
|
||||
index 56ce2e1..7789296 100644
|
||||
--- a/govirt/ovirt-utils.c
|
||||
+++ b/govirt/ovirt-utils.c
|
||||
@@ -181,6 +181,7 @@ _set_property_value_from_type(GValue *value,
|
||||
const char *value_str;
|
||||
GType type = prop->value_type;
|
||||
|
||||
+ /* These types do not require a value associated */
|
||||
if (g_type_is_a(type, OVIRT_TYPE_RESOURCE)) {
|
||||
OvirtResource *resource_value = ovirt_resource_new_from_xml(type, node, NULL);
|
||||
g_value_set_object(value, resource_value);
|
||||
@@ -210,6 +211,10 @@ _set_property_value_from_type(GValue *value,
|
||||
int enum_value = ovirt_utils_genum_get_value(type, value_str, enum_prop->default_value);
|
||||
g_value_set_enum(value, enum_value);
|
||||
goto end;
|
||||
+ } else if (g_type_is_a(type, G_TYPE_BYTE_ARRAY)) {
|
||||
+ GByteArray *array = g_byte_array_new_take((guchar *)g_strdup(value_str), strlen(value_str));
|
||||
+ g_value_take_boxed(value, array);
|
||||
+ goto end;
|
||||
}
|
||||
|
||||
ret = _set_property_value_from_basic_type(value, type, value_str);
|
||||
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c
|
||||
index ebb04c2..a8a946a 100644
|
||||
--- a/govirt/ovirt-vm-display.c
|
||||
+++ b/govirt/ovirt-vm-display.c
|
||||
@@ -336,6 +336,9 @@ static gboolean ovirt_vm_display_set_from_xml(OvirtVmDisplay *display, RestXmlNo
|
||||
{ .prop_name = "proxy-url",
|
||||
.xml_path = "proxy",
|
||||
},
|
||||
+ { .prop_name = "ca-cert",
|
||||
+ .xml_path = "certificate/content",
|
||||
+ },
|
||||
{ NULL, },
|
||||
};
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,39 @@
|
||||
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
|
||||
|
26
SOURCES/0049-proxy-Do-not-leak-display-object.patch
Normal file
26
SOURCES/0049-proxy-Do-not-leak-display-object.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 61b2753958118b910dfbc9270cccfee80d165b0a 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 leak display object
|
||||
|
||||
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
||||
---
|
||||
govirt/ovirt-proxy.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
||||
index 74604dd..92c5ed0 100644
|
||||
--- a/govirt/ovirt-proxy.c
|
||||
+++ b/govirt/ovirt-proxy.c
|
||||
@@ -636,7 +636,7 @@ static void ovirt_proxy_update_vm_display_ca(OvirtProxy *proxy)
|
||||
g_object_get(G_OBJECT(display), "ca-cert", &ca_cert, NULL);
|
||||
if (ca_cert != NULL) {
|
||||
g_byte_array_unref(ca_cert);
|
||||
- ca_cert = NULL;
|
||||
+ g_object_unref(display);
|
||||
continue;
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
90
SOURCES/0050-Add-support-for-oVirt-API-v4.patch
Normal file
90
SOURCES/0050-Add-support-for-oVirt-API-v4.patch
Normal file
@ -0,0 +1,90 @@
|
||||
From 7fc76f7cea0efe8fdf48033b616cfd107cd9bd56 Mon Sep 17 00:00:00 2001
|
||||
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||
Date: Mon, 20 Jan 2020 19:16:49 -0300
|
||||
Subject: [PATCH] Add support for oVirt API v4
|
||||
|
||||
v3 has been deprecated for a while now, and support will be completely
|
||||
removed in RHV 4.4.
|
||||
|
||||
Tested against main use cases with remote-viewer:
|
||||
|
||||
- Connecting to oVirt using ovirt:// URI.
|
||||
- Connecting to oVirt with console.vv file.
|
||||
- Listing and changing CD ROMs.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1399750
|
||||
|
||||
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
||||
---
|
||||
govirt/ovirt-proxy.c | 1 -
|
||||
govirt/ovirt-resource.c | 7 -------
|
||||
govirt/ovirt-storage-domain.c | 2 +-
|
||||
govirt/ovirt-vm.c | 2 +-
|
||||
4 files changed, 2 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
||||
index 92c5ed0..39ef476 100644
|
||||
--- a/govirt/ovirt-proxy.c
|
||||
+++ b/govirt/ovirt-proxy.c
|
||||
@@ -943,7 +943,6 @@ static void ovirt_proxy_constructed(GObject *gobject)
|
||||
g_object_set(OVIRT_PROXY(gobject), "ssl-strict", FALSE, NULL);
|
||||
}
|
||||
ovirt_proxy_add_header(OVIRT_PROXY(gobject), "Prefer", "persistent-auth");
|
||||
- ovirt_proxy_add_header(OVIRT_PROXY(gobject), "Version", "3");
|
||||
|
||||
/* Chain up to the parent class */
|
||||
if (G_OBJECT_CLASS(ovirt_proxy_parent_class)->constructed)
|
||||
diff --git a/govirt/ovirt-resource.c b/govirt/ovirt-resource.c
|
||||
index 936e912..9511e2f 100644
|
||||
--- a/govirt/ovirt-resource.c
|
||||
+++ b/govirt/ovirt-resource.c
|
||||
@@ -686,7 +686,6 @@ static enum OvirtResponseStatus parse_action_status(RestXmlNode *root,
|
||||
{
|
||||
RestXmlNode *node;
|
||||
const char *status_key = g_intern_string("status");
|
||||
- const char *state_key = g_intern_string("state");
|
||||
|
||||
g_return_val_if_fail(g_strcmp0(root->name, "action") == 0,
|
||||
OVIRT_RESPONSE_UNKNOWN);
|
||||
@@ -699,12 +698,6 @@ static enum OvirtResponseStatus parse_action_status(RestXmlNode *root,
|
||||
_("Could not find 'status' node"));
|
||||
g_return_val_if_reached(OVIRT_RESPONSE_UNKNOWN);
|
||||
}
|
||||
- node = g_hash_table_lookup(node->children, state_key);
|
||||
- if (node == NULL) {
|
||||
- g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
|
||||
- _("Could not find 'state' node"));
|
||||
- g_return_val_if_reached(OVIRT_RESPONSE_UNKNOWN);
|
||||
- }
|
||||
g_debug("State: %s\n", node->content);
|
||||
if (g_strcmp0(node->content, "complete") == 0) {
|
||||
return OVIRT_RESPONSE_COMPLETE;
|
||||
diff --git a/govirt/ovirt-storage-domain.c b/govirt/ovirt-storage-domain.c
|
||||
index a9078f4..4eb3354 100644
|
||||
--- a/govirt/ovirt-storage-domain.c
|
||||
+++ b/govirt/ovirt-storage-domain.c
|
||||
@@ -171,7 +171,7 @@ static gboolean ovirt_storage_domain_init_from_xml(OvirtResource *resource,
|
||||
.xml_path = "storage_format",
|
||||
},
|
||||
{ .prop_name = "state",
|
||||
- .xml_path = "status/state",
|
||||
+ .xml_path = "status",
|
||||
},
|
||||
{ .prop_name = "data-center-ids",
|
||||
.xml_path = "data_centers",
|
||||
diff --git a/govirt/ovirt-vm.c b/govirt/ovirt-vm.c
|
||||
index 8cd482b..7e1dec1 100644
|
||||
--- a/govirt/ovirt-vm.c
|
||||
+++ b/govirt/ovirt-vm.c
|
||||
@@ -201,7 +201,7 @@ static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
|
||||
.xml_attr = "id",
|
||||
},
|
||||
{ .prop_name = "state",
|
||||
- .xml_path = "status/state",
|
||||
+ .xml_path = "status",
|
||||
},
|
||||
{ NULL, },
|
||||
};
|
||||
--
|
||||
2.25.1
|
||||
|
@ -0,0 +1,26 @@
|
||||
From 8401d58557bfe45a5289e37bbd443335b49ee32a Mon Sep 17 00:00:00 2001
|
||||
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
||||
Date: Tue, 21 Jan 2020 10:41:18 -0300
|
||||
Subject: [PATCH] tests: Update VM XML according to new API version
|
||||
|
||||
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
||||
---
|
||||
tests/test-govirt.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/test-govirt.c b/tests/test-govirt.c
|
||||
index fd4e0af..99901e0 100644
|
||||
--- a/tests/test-govirt.c
|
||||
+++ b/tests/test-govirt.c
|
||||
@@ -136,7 +136,7 @@ static void test_govirt_list_vms(void)
|
||||
<vm href=\"api/vms/uuid1\" id=\"uuid1\"> \
|
||||
<name>vm1</name> \
|
||||
<type>desktop</type> \
|
||||
- <status><state>up</state></status> \
|
||||
+ <status>up</status> \
|
||||
<display> \
|
||||
<type>spice</type> \
|
||||
<address>10.0.0.123</address> \
|
||||
--
|
||||
2.25.1
|
||||
|
@ -17,7 +17,7 @@
|
||||
Summary: A GObject library for interacting with oVirt REST API
|
||||
Name: libgovirt
|
||||
Version: 0.3.4
|
||||
Release: 9%{?dist}%{?extra_release}
|
||||
Release: 12%{?dist}%{?extra_release}
|
||||
License: LGPLv2+
|
||||
Group: Development/Libraries
|
||||
Source0: http://ftp.gnome.org/pub/GNOME/sources/libgovirt/0.3/%{name}-%{version}.tar.xz
|
||||
@ -71,6 +71,11 @@ 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
|
||||
Patch48: 0047-vm-display-Add-support-for-parsing-certificate-data.patch
|
||||
Patch49: 0048-proxy-Do-not-overwrite-certificate-data-from-display.patch
|
||||
Patch50: 0049-proxy-Do-not-leak-display-object.patch
|
||||
Patch51: 0050-Add-support-for-oVirt-API-v4.patch
|
||||
Patch52: 0051-tests-Update-VM-XML-according-to-new-API-version.patch
|
||||
|
||||
%if 0%{?enable_autotools}
|
||||
BuildRequires: autoconf
|
||||
@ -158,6 +163,18 @@ make check
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Apr 9 2020 Tomas Pelka <tpelka@redhat.com> - 0.3.4-12
|
||||
- Bumped version and rebuildccagaincafter z-stream unfreeze to trigger gating for 8.2.0.z properly
|
||||
Resolves: rhbz#1813962
|
||||
|
||||
* Mon Mar 16 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-11
|
||||
- Bumped version and rebuild to trigger gating for 8.2.0.z properly
|
||||
Resolves: rhbz#1813962
|
||||
|
||||
* Mon Mar 16 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-10
|
||||
- Update to RHV REST API version 4
|
||||
Resolves: rhbz#1813962
|
||||
|
||||
* Mon Aug 2 2019 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-9
|
||||
- Sync with the rhel 7.7 package
|
||||
Related: rhbz#1717900
|
||||
|
Loading…
Reference in New Issue
Block a user