21951c
import libgovirt-0.3.4-12.el8_2
@@ -0,0 +1,56 @@
|
|
1
|
+
From 0fceae5b08888ae04d0f984aaa2583ca39756880 Mon Sep 17 00:00:00 2001
|
2
|
+
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
3
|
+
Date: Thu, 3 Oct 2019 15:30:46 -0300
|
4
|
+
Subject: [PATCH] vm-display: Add support for parsing certificate data
|
5
|
+
|
6
|
+
Certificate data is stored as GByteArray, thus requiring support for
|
7
|
+
G_TYPE_BYTE_ARRAY in ovirt-utils.
|
8
|
+
|
9
|
+
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1402909
|
10
|
+
|
11
|
+
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
12
|
+
---
|
13
|
+
govirt/ovirt-utils.c | 5 +++++
|
14
|
+
govirt/ovirt-vm-display.c | 3 +++
|
15
|
+
2 files changed, 8 insertions(+)
|
16
|
+
|
17
|
+
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
|
18
|
+
index 56ce2e1..7789296 100644
|
19
|
+
--- a/govirt/ovirt-utils.c
|
20
|
+
+++ b/govirt/ovirt-utils.c
|
21
|
+
@@ -181,6 +181,7 @@ _set_property_value_from_type(GValue *value,
|
22
|
+
const char *value_str;
|
23
|
+
GType type = prop->value_type;
|
24
|
+
|
25
|
+
+ /* These types do not require a value associated */
|
26
|
+
if (g_type_is_a(type, OVIRT_TYPE_RESOURCE)) {
|
27
|
+
OvirtResource *resource_value = ovirt_resource_new_from_xml(type, node, NULL);
|
28
|
+
g_value_set_object(value, resource_value);
|
29
|
+
@@ -210,6 +211,10 @@ _set_property_value_from_type(GValue *value,
|
30
|
+
int enum_value = ovirt_utils_genum_get_value(type, value_str, enum_prop->default_value);
|
31
|
+
g_value_set_enum(value, enum_value);
|
32
|
+
goto end;
|
33
|
+
+ } else if (g_type_is_a(type, G_TYPE_BYTE_ARRAY)) {
|
34
|
+
+ GByteArray *array = g_byte_array_new_take((guchar *)g_strdup(value_str), strlen(value_str));
|
35
|
+
+ g_value_take_boxed(value, array);
|
36
|
+
+ goto end;
|
37
|
+
}
|
38
|
+
|
39
|
+
ret = _set_property_value_from_basic_type(value, type, value_str);
|
40
|
+
diff --git a/govirt/ovirt-vm-display.c b/govirt/ovirt-vm-display.c
|
41
|
+
index ebb04c2..a8a946a 100644
|
42
|
+
--- a/govirt/ovirt-vm-display.c
|
43
|
+
+++ b/govirt/ovirt-vm-display.c
|
44
|
+
@@ -336,6 +336,9 @@ static gboolean ovirt_vm_display_set_from_xml(OvirtVmDisplay *display, RestXmlNo
|
45
|
+
{ .prop_name = "proxy-url",
|
46
|
+
.xml_path = "proxy",
|
47
|
+
},
|
48
|
+
+ { .prop_name = "ca-cert",
|
49
|
+
+ .xml_path = "certificate/content",
|
50
|
+
+ },
|
51
|
+
{ NULL, },
|
52
|
+
};
|
53
|
+
|
54
|
+
--
|
55
|
+
2.21.0
|
56
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
From cf2c7c6b5ee1b636d7f443a4442374e9e254c164 Mon Sep 17 00:00:00 2001
|
2
|
+
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
3
|
+
Date: Thu, 3 Oct 2019 17:18:58 -0300
|
4
|
+
Subject: [PATCH] proxy: Do not overwrite certificate data from display
|
5
|
+
|
6
|
+
Since oVirt 4.3, certificate data is available from the XML see:
|
7
|
+
|
8
|
+
https://bugzilla.redhat.com/show_bug.cgi?id=1403161
|
9
|
+
|
10
|
+
Previous commit adds support for using that value instead of the one
|
11
|
+
obtained from proxy object.
|
12
|
+
|
13
|
+
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
14
|
+
---
|
15
|
+
govirt/ovirt-proxy.c | 8 ++++++++
|
16
|
+
1 file changed, 8 insertions(+)
|
17
|
+
|
18
|
+
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
19
|
+
index 9cdd211..74604dd 100644
|
20
|
+
--- a/govirt/ovirt-proxy.c
|
21
|
+
+++ b/govirt/ovirt-proxy.c
|
22
|
+
@@ -632,6 +632,14 @@ static void ovirt_proxy_update_vm_display_ca(OvirtProxy *proxy)
|
23
|
+
|
24
|
+
g_object_get(G_OBJECT(vm), "display", &display, NULL);
|
25
|
+
if (display != NULL) {
|
26
|
+
+ GByteArray *ca_cert = NULL;
|
27
|
+
+ g_object_get(G_OBJECT(display), "ca-cert", &ca_cert, NULL);
|
28
|
+
+ if (ca_cert != NULL) {
|
29
|
+
+ g_byte_array_unref(ca_cert);
|
30
|
+
+ ca_cert = NULL;
|
31
|
+
+ continue;
|
32
|
+
+ }
|
33
|
+
+
|
34
|
+
g_object_set(G_OBJECT(display),
|
35
|
+
"ca-cert", proxy->priv->display_ca,
|
36
|
+
NULL);
|
37
|
+
--
|
38
|
+
2.21.0
|
39
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
From 61b2753958118b910dfbc9270cccfee80d165b0a Mon Sep 17 00:00:00 2001
|
2
|
+
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
3
|
+
Date: Thu, 3 Oct 2019 17:18:58 -0300
|
4
|
+
Subject: [PATCH] proxy: Do not leak display object
|
5
|
+
|
6
|
+
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
7
|
+
---
|
8
|
+
govirt/ovirt-proxy.c | 2 +-
|
9
|
+
1 file changed, 1 insertion(+), 1 deletion(-)
|
10
|
+
|
11
|
+
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
12
|
+
index 74604dd..92c5ed0 100644
|
13
|
+
--- a/govirt/ovirt-proxy.c
|
14
|
+
+++ b/govirt/ovirt-proxy.c
|
15
|
+
@@ -636,7 +636,7 @@ static void ovirt_proxy_update_vm_display_ca(OvirtProxy *proxy)
|
16
|
+
g_object_get(G_OBJECT(display), "ca-cert", &ca_cert, NULL);
|
17
|
+
if (ca_cert != NULL) {
|
18
|
+
g_byte_array_unref(ca_cert);
|
19
|
+
- ca_cert = NULL;
|
20
|
+
+ g_object_unref(display);
|
21
|
+
continue;
|
22
|
+
}
|
23
|
+
|
24
|
+
--
|
25
|
+
2.21.0
|
26
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
From 7fc76f7cea0efe8fdf48033b616cfd107cd9bd56 Mon Sep 17 00:00:00 2001
|
2
|
+
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
3
|
+
Date: Mon, 20 Jan 2020 19:16:49 -0300
|
4
|
+
Subject: [PATCH] Add support for oVirt API v4
|
5
|
+
|
6
|
+
v3 has been deprecated for a while now, and support will be completely
|
7
|
+
removed in RHV 4.4.
|
8
|
+
|
9
|
+
Tested against main use cases with remote-viewer:
|
10
|
+
|
11
|
+
- Connecting to oVirt using ovirt:// URI.
|
12
|
+
- Connecting to oVirt with console.vv file.
|
13
|
+
- Listing and changing CD ROMs.
|
14
|
+
|
15
|
+
https://bugzilla.redhat.com/show_bug.cgi?id=1399750
|
16
|
+
|
17
|
+
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
18
|
+
---
|
19
|
+
govirt/ovirt-proxy.c | 1 -
|
20
|
+
govirt/ovirt-resource.c | 7 -------
|
21
|
+
govirt/ovirt-storage-domain.c | 2 +-
|
22
|
+
govirt/ovirt-vm.c | 2 +-
|
23
|
+
4 files changed, 2 insertions(+), 10 deletions(-)
|
24
|
+
|
25
|
+
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
|
26
|
+
index 92c5ed0..39ef476 100644
|
27
|
+
--- a/govirt/ovirt-proxy.c
|
28
|
+
+++ b/govirt/ovirt-proxy.c
|
29
|
+
@@ -943,7 +943,6 @@ static void ovirt_proxy_constructed(GObject *gobject)
|
30
|
+
g_object_set(OVIRT_PROXY(gobject), "ssl-strict", FALSE, NULL);
|
31
|
+
}
|
32
|
+
ovirt_proxy_add_header(OVIRT_PROXY(gobject), "Prefer", "persistent-auth");
|
33
|
+
- ovirt_proxy_add_header(OVIRT_PROXY(gobject), "Version", "3");
|
34
|
+
|
35
|
+
/* Chain up to the parent class */
|
36
|
+
if (G_OBJECT_CLASS(ovirt_proxy_parent_class)->constructed)
|
37
|
+
diff --git a/govirt/ovirt-resource.c b/govirt/ovirt-resource.c
|
38
|
+
index 936e912..9511e2f 100644
|
39
|
+
--- a/govirt/ovirt-resource.c
|
40
|
+
+++ b/govirt/ovirt-resource.c
|
41
|
+
@@ -686,7 +686,6 @@ static enum OvirtResponseStatus parse_action_status(RestXmlNode *root,
|
42
|
+
{
|
43
|
+
RestXmlNode *node;
|
44
|
+
const char *status_key = g_intern_string("status");
|
45
|
+
- const char *state_key = g_intern_string("state");
|
46
|
+
|
47
|
+
g_return_val_if_fail(g_strcmp0(root->name, "action") == 0,
|
48
|
+
OVIRT_RESPONSE_UNKNOWN);
|
49
|
+
@@ -699,12 +698,6 @@ static enum OvirtResponseStatus parse_action_status(RestXmlNode *root,
|
50
|
+
_("Could not find 'status' node"));
|
51
|
+
g_return_val_if_reached(OVIRT_RESPONSE_UNKNOWN);
|
52
|
+
}
|
53
|
+
- node = g_hash_table_lookup(node->children, state_key);
|
54
|
+
- if (node == NULL) {
|
55
|
+
- g_set_error(error, OVIRT_ERROR, OVIRT_ERROR_PARSING_FAILED,
|
56
|
+
- _("Could not find 'state' node"));
|
57
|
+
- g_return_val_if_reached(OVIRT_RESPONSE_UNKNOWN);
|
58
|
+
- }
|
59
|
+
g_debug("State: %s\n", node->content);
|
60
|
+
if (g_strcmp0(node->content, "complete") == 0) {
|
61
|
+
return OVIRT_RESPONSE_COMPLETE;
|
62
|
+
diff --git a/govirt/ovirt-storage-domain.c b/govirt/ovirt-storage-domain.c
|
63
|
+
index a9078f4..4eb3354 100644
|
64
|
+
--- a/govirt/ovirt-storage-domain.c
|
65
|
+
+++ b/govirt/ovirt-storage-domain.c
|
66
|
+
@@ -171,7 +171,7 @@ static gboolean ovirt_storage_domain_init_from_xml(OvirtResource *resource,
|
67
|
+
.xml_path = "storage_format",
|
68
|
+
},
|
69
|
+
{ .prop_name = "state",
|
70
|
+
- .xml_path = "status/state",
|
71
|
+
+ .xml_path = "status",
|
72
|
+
},
|
73
|
+
{ .prop_name = "data-center-ids",
|
74
|
+
.xml_path = "data_centers",
|
75
|
+
diff --git a/govirt/ovirt-vm.c b/govirt/ovirt-vm.c
|
76
|
+
index 8cd482b..7e1dec1 100644
|
77
|
+
--- a/govirt/ovirt-vm.c
|
78
|
+
+++ b/govirt/ovirt-vm.c
|
79
|
+
@@ -201,7 +201,7 @@ static gboolean ovirt_vm_init_from_xml(OvirtResource *resource,
|
80
|
+
.xml_attr = "id",
|
81
|
+
},
|
82
|
+
{ .prop_name = "state",
|
83
|
+
- .xml_path = "status/state",
|
84
|
+
+ .xml_path = "status",
|
85
|
+
},
|
86
|
+
{ NULL, },
|
87
|
+
};
|
88
|
+
--
|
89
|
+
2.25.1
|
90
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
From 8401d58557bfe45a5289e37bbd443335b49ee32a Mon Sep 17 00:00:00 2001
|
2
|
+
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
|
3
|
+
Date: Tue, 21 Jan 2020 10:41:18 -0300
|
4
|
+
Subject: [PATCH] tests: Update VM XML according to new API version
|
5
|
+
|
6
|
+
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
|
7
|
+
---
|
8
|
+
tests/test-govirt.c | 2 +-
|
9
|
+
1 file changed, 1 insertion(+), 1 deletion(-)
|
10
|
+
|
11
|
+
diff --git a/tests/test-govirt.c b/tests/test-govirt.c
|
12
|
+
index fd4e0af..99901e0 100644
|
13
|
+
--- a/tests/test-govirt.c
|
14
|
+
+++ b/tests/test-govirt.c
|
15
|
+
@@ -136,7 +136,7 @@ static void test_govirt_list_vms(void)
|
16
|
+
<vm href=\"api/vms/uuid1\" id=\"uuid1\"> \
|
17
|
+
<name>vm1</name> \
|
18
|
+
<type>desktop</type> \
|
19
|
+
- <status><state>up</state></status> \
|
20
|
+
+ <status>up</status> \
|
21
|
+
<display> \
|
22
|
+
<type>spice</type> \
|
23
|
+
<address>10.0.0.123</address> \
|
24
|
+
--
|
25
|
+
2.25.1
|
26
|
+
|
@@ -17,7 +17,7 @@
|
|
17
17
|
Summary: A GObject library for interacting with oVirt REST API
|
18
18
|
Name: libgovirt
|
19
19
|
Version: 0.3.4
|
20
|
-
Release:
|
20
|
+
Release: 12%{?dist}%{?extra_release}
|
21
21
|
License: LGPLv2+
|
22
22
|
Group: Development/Libraries
|
23
23
|
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
|
|
71
71
|
Patch45: 0045-utils-Check-for-valid-data-before-calling-rest_xml_p.patch
|
72
72
|
Patch46: 0046-Update-tests-certificates.patch
|
73
73
|
Patch47: 0047-cdrom-Remove-unused-variable.patch
|
74
|
+
Patch48: 0047-vm-display-Add-support-for-parsing-certificate-data.patch
|
75
|
+
Patch49: 0048-proxy-Do-not-overwrite-certificate-data-from-display.patch
|
76
|
+
Patch50: 0049-proxy-Do-not-leak-display-object.patch
|
77
|
+
Patch51: 0050-Add-support-for-oVirt-API-v4.patch
|
78
|
+
Patch52: 0051-tests-Update-VM-XML-according-to-new-API-version.patch
|
74
79
|
|
75
80
|
%if 0%{?enable_autotools}
|
76
81
|
BuildRequires: autoconf
|
@@ -158,6 +163,18 @@ make check
|
|
158
163
|
%endif
|
159
164
|
|
160
165
|
%changelog
|
166
|
+
* Thu Apr 9 2020 Tomas Pelka <tpelka@redhat.com> - 0.3.4-12
|
167
|
+
- Bumped version and rebuildccagaincafter z-stream unfreeze to trigger gating for 8.2.0.z properly
|
168
|
+
Resolves: rhbz#1813962
|
169
|
+
|
170
|
+
* Mon Mar 16 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-11
|
171
|
+
- Bumped version and rebuild to trigger gating for 8.2.0.z properly
|
172
|
+
Resolves: rhbz#1813962
|
173
|
+
|
174
|
+
* Mon Mar 16 2020 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-10
|
175
|
+
- Update to RHV REST API version 4
|
176
|
+
Resolves: rhbz#1813962
|
177
|
+
|
161
178
|
* Mon Aug 2 2019 Eduardo Lima (Etrunko) <etrunko@redhat.com> - 0.3.4-9
|
162
179
|
- Sync with the rhel 7.7 package
|
163
180
|
Related: rhbz#1717900
|