From 10200056c4a8da52dcd40fa96e96201c1e70f8f3 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:19:55 +0000 Subject: import libgovirt-0.3.3-5.el7 --- diff --git a/SOURCES/0009-New-storage-format-added-in-oVirt-4.1.patch b/SOURCES/0009-New-storage-format-added-in-oVirt-4.1.patch new file mode 100644 index 0000000..458e9fa --- /dev/null +++ b/SOURCES/0009-New-storage-format-added-in-oVirt-4.1.patch @@ -0,0 +1,25 @@ +From 145880f32823672e7c4fd5814ae6f2c5a0010756 Mon Sep 17 00:00:00 2001 +From: "Eduardo Lima (Etrunko)" +Date: Tue, 21 Feb 2017 11:20:38 -0300 +Subject: [PATCH 3/3] New storage format added in oVirt 4.1 + +Signed-off-by: Eduardo Lima (Etrunko) +--- + govirt/ovirt-storage-domain.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/govirt/ovirt-storage-domain.h b/govirt/ovirt-storage-domain.h +index 15c3340..79f1741 100644 +--- a/govirt/ovirt-storage-domain.h ++++ b/govirt/ovirt-storage-domain.h +@@ -41,6 +41,7 @@ typedef enum { + OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V1, + OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V2, + OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V3, ++ OVIRT_STORAGE_DOMAIN_FORMAT_VERSION_V4, + } OvirtStorageDomainFormatVersion; + + typedef enum { +-- +2.9.3 + diff --git a/SOURCES/0010-proxy-Fix-bug-in-cancelled-disconnection-after-async.patch b/SOURCES/0010-proxy-Fix-bug-in-cancelled-disconnection-after-async.patch new file mode 100644 index 0000000..5bc6965 --- /dev/null +++ b/SOURCES/0010-proxy-Fix-bug-in-cancelled-disconnection-after-async.patch @@ -0,0 +1,34 @@ +From 775a3530f5cb6d8709a76e0c2f55324adf78d6c0 Mon Sep 17 00:00:00 2001 +From: Christophe Fergeau +Date: Mon, 3 Aug 2015 14:23:28 +0200 +Subject: [PATCH 1/3] proxy: Fix bug in 'cancelled' disconnection after async + calls + +9aa3aec8 added disconnection of the 'cancelled' signal on the +cancellable in async calls once the async call has completed to prevent +a crash. However, there was a bug in this patch as we only disconnect +from 'cancelled' if data->cancellable is not NULL, and there was one +code path where setting data->cancellable was forgotten. +A few refactorings later, the buggy codepath is the only one which +remains, so the bug fixed in 9aa3aec8 is back... + +This commit makes sure data->cancellable is set when needed. +--- + govirt/ovirt-proxy.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c +index 81f3f98..28f8e8a 100644 +--- a/govirt/ovirt-proxy.c ++++ b/govirt/ovirt-proxy.c +@@ -284,6 +284,7 @@ void ovirt_rest_call_async(OvirtRestCall *call, + data->call_user_data = user_data; + data->destroy_call_data = destroy_func; + if (cancellable != NULL) { ++ data->cancellable = cancellable; + data->cancellable_cb_id = g_cancellable_connect(cancellable, + G_CALLBACK (call_async_cancelled_cb), + call, NULL); +-- +2.9.3 + diff --git a/SOURCES/0011-proxy-Hold-reference-to-cancellable-object.patch b/SOURCES/0011-proxy-Hold-reference-to-cancellable-object.patch new file mode 100644 index 0000000..0785757 --- /dev/null +++ b/SOURCES/0011-proxy-Hold-reference-to-cancellable-object.patch @@ -0,0 +1,38 @@ +From 25beefa304af1fa5ce529401ccb19aac252dd185 Mon Sep 17 00:00:00 2001 +From: "Eduardo Lima (Etrunko)" +Date: Thu, 2 Feb 2017 15:11:42 -0200 +Subject: [PATCH 1/3] proxy: Hold reference to cancellable object + +Being an asynchronous operation, there is no guarantee that the object +is valid by the time of the cleanup, so we hold a reference to it to +ensure it. + +Signed-off-by: Eduardo Lima (Etrunko) +--- + govirt/ovirt-proxy.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c +index 10cc25f..70c08ac 100644 +--- a/govirt/ovirt-proxy.c ++++ b/govirt/ovirt-proxy.c +@@ -218,6 +218,7 @@ static void ovirt_proxy_call_async_data_free(OvirtProxyCallAsyncData *data) + if ((data->cancellable != NULL) && (data->cancellable_cb_id != 0)) { + g_cancellable_disconnect(data->cancellable, data->cancellable_cb_id); + } ++ g_clear_object(&data->cancellable); + g_slice_free(OvirtProxyCallAsyncData, data); + } + +@@ -282,7 +283,7 @@ void ovirt_rest_call_async(OvirtRestCall *call, + data->call_user_data = user_data; + data->destroy_call_data = destroy_func; + if (cancellable != NULL) { +- data->cancellable = cancellable; ++ data->cancellable = g_object_ref(cancellable); + data->cancellable_cb_id = g_cancellable_connect(cancellable, + G_CALLBACK (call_async_cancelled_cb), + call, NULL); +-- +2.9.3 + diff --git a/SOURCES/0012-proxy-Check-if-operation-is-cancelled-before-disconn.patch b/SOURCES/0012-proxy-Check-if-operation-is-cancelled-before-disconn.patch new file mode 100644 index 0000000..66d2c94 --- /dev/null +++ b/SOURCES/0012-proxy-Check-if-operation-is-cancelled-before-disconn.patch @@ -0,0 +1,43 @@ +From 096eee1d6acbf8c28e880ccb7d214f6589f07191 Mon Sep 17 00:00:00 2001 +From: "Eduardo Lima (Etrunko)" +Date: Thu, 2 Feb 2017 15:13:48 -0200 +Subject: [PATCH 3/3] proxy: Check if operation is cancelled before + disconnecting signal + +According to the documentation, g_cancellable_disconnect() waits for the +signal handler to finish, and if it is called from the handler itself, it +will result in a deadlock. To avoid it, we check if the operation is +cancelled and if so, call g_signal_handler_disconnect() instead of +g_cancellable_disconnect(). + +https://developer.gnome.org/gio/stable/GCancellable.html#g-cancellable-disconnect + +Signed-off-by: Eduardo Lima (Etrunko) +--- + govirt/ovirt-proxy.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c +index 2ff05cd..deea43f 100644 +--- a/govirt/ovirt-proxy.c ++++ b/govirt/ovirt-proxy.c +@@ -218,7 +218,15 @@ static void ovirt_proxy_call_async_data_free(OvirtProxyCallAsyncData *data) + g_object_unref(G_OBJECT(data->result)); + } + if ((data->cancellable != NULL) && (data->cancellable_cb_id != 0)) { +- g_cancellable_disconnect(data->cancellable, data->cancellable_cb_id); ++ if (g_cancellable_is_cancelled(data->cancellable)) { ++ /* Cancellable has already been cancelled, we don't need to use ++ * g_cancellable_disconnect() to disconnect the signal handler ++ * as we know the 'cancelled' signal is no longer going to be emitted ++ */ ++ g_signal_handler_disconnect(data->cancellable, data->cancellable_cb_id); ++ } else { ++ g_cancellable_disconnect(data->cancellable, data->cancellable_cb_id); ++ } + } + g_clear_object(&data->cancellable); + g_slice_free(OvirtProxyCallAsyncData, data); +-- +2.9.3 + diff --git a/SPECS/libgovirt.spec b/SPECS/libgovirt.spec index 5cc08ee..cafaae4 100644 --- a/SPECS/libgovirt.spec +++ b/SPECS/libgovirt.spec @@ -9,7 +9,7 @@ Summary: A GObject library for interacting with oVirt REST API Name: libgovirt Version: 0.3.3 -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 @@ -22,6 +22,10 @@ Patch0005: 0005-proxy-Remove-jsessionid-cookie-when-its-value-is-NUL.patch Patch0006: 0006-proxy-Only-set-Prefer-persistent-auth-with-jsession-.patch Patch0007: 0007-proxy-Fix-persistent-session-with-oVirt-3.6.patch Patch0008: 0008-Force-use-of-v3-REST-API.patch +Patch0009: 0009-New-storage-format-added-in-oVirt-4.1.patch +Patch0010: 0010-proxy-Fix-bug-in-cancelled-disconnection-after-async.patch +Patch0011: 0011-proxy-Hold-reference-to-cancellable-object.patch +Patch0012: 0012-proxy-Check-if-operation-is-cancelled-before-disconn.patch BuildRequires: glib2-devel BuildRequires: intltool @@ -93,6 +97,12 @@ make check %endif %changelog +* Mon Mar 13 2017 Eduardo Lima (Etrunko) - 0.3.3-5 +- New storage format added in oVirt 4.1 + Resolves: rhbz#1346215 +- Check if operation was cancelled before disconnecting signal + Resolves: rhbz#1431275 + * Fri Jul 01 2016 Christophe Fergeau - 0.3.3-4 - Add upstream patch forcing use of the older v3 REST API as we don't support yet the v4 API