diff --git a/SOURCES/0050-Add-support-for-oVirt-API-v4.patch b/SOURCES/0050-Add-support-for-oVirt-API-v4.patch new file mode 100644 index 0000000..1ae83ca --- /dev/null +++ b/SOURCES/0050-Add-support-for-oVirt-API-v4.patch @@ -0,0 +1,90 @@ +From 7fc76f7cea0efe8fdf48033b616cfd107cd9bd56 Mon Sep 17 00:00:00 2001 +From: "Eduardo Lima (Etrunko)" +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) +--- + 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 + diff --git a/SOURCES/0051-tests-Update-VM-XML-according-to-new-API-version.patch b/SOURCES/0051-tests-Update-VM-XML-according-to-new-API-version.patch new file mode 100644 index 0000000..ceaa92f --- /dev/null +++ b/SOURCES/0051-tests-Update-VM-XML-according-to-new-API-version.patch @@ -0,0 +1,26 @@ +From 8401d58557bfe45a5289e37bbd443335b49ee32a Mon Sep 17 00:00:00 2001 +From: "Eduardo Lima (Etrunko)" +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) +--- + 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) + \ + vm1 \ + desktop \ +- up \ ++ up \ + \ + spice \ +
10.0.0.123
\ +-- +2.25.1 + diff --git a/SPECS/libgovirt.spec b/SPECS/libgovirt.spec index 1a20865..e71e23e 100644 --- a/SPECS/libgovirt.spec +++ b/SPECS/libgovirt.spec @@ -17,7 +17,7 @@ Summary: A GObject library for interacting with oVirt REST API Name: libgovirt Version: 0.3.4 -Release: 4%{?dist}%{?extra_release} +Release: 5%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries Source: http://ftp.gnome.org/pub/GNOME/sources/libgovirt/0.3/%{name}-%{version}.tar.xz @@ -71,6 +71,8 @@ Patch46: 0046-Update-tests-certificates.patch Patch47: 0047-vm-display-Add-support-for-parsing-certificate-data.patch Patch48: 0048-proxy-Do-not-overwrite-certificate-data-from-display.patch Patch49: 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 @@ -156,6 +158,10 @@ make check %endif %changelog +* Wed May 06 2020 Eduardo Lima (Etrunko) - 0.3.4-5 +- Update to RHV REST API version 4 + Resolves: rhbz#1832281 + * Thu Oct 03 2019 Eduardo Lima (Etrunko) - 0.3.4-4 - Use certificate data from XML Resolves: rhbz#https://bugzilla.redhat.com/show_bug.cgi?id=1402909