From c869aeb9fb5bdc71cf8265f27389676c2064e699 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 31 Jan 2012 14:49:43 +0100 Subject: [PATCH] New upstream release 0.9 --- .gitignore | 1 + 0001-Handle-spice_audio_new-failures.patch | 32 ---- ...low-calling-spice_msg_out_send-from-.patch | 141 ------------------ sources | 2 +- spice-gtk.spec | 13 +- 5 files changed, 6 insertions(+), 183 deletions(-) delete mode 100644 0001-Handle-spice_audio_new-failures.patch delete mode 100644 0002-spice-channel-Allow-calling-spice_msg_out_send-from-.patch diff --git a/.gitignore b/.gitignore index 57e959b..9c3d307 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /spice-gtk-0.7.1-d5a8.tar.bz2 /spice-gtk-0.7.39-ab64.tar.bz2 /spice-gtk-0.8.tar.bz2 +/spice-gtk-0.9.tar.bz2 diff --git a/0001-Handle-spice_audio_new-failures.patch b/0001-Handle-spice_audio_new-failures.patch deleted file mode 100644 index 17fb08f..0000000 --- a/0001-Handle-spice_audio_new-failures.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 424c67ab1e6be34a35a5133f6037950b8bcb25b7 Mon Sep 17 00:00:00 2001 -From: Christophe Fergeau -Date: Fri, 13 Jan 2012 19:19:40 +0100 -Subject: [PATCH spice-gtk 1/3] Handle spice_audio_new failures - -spice_audio_new can return a NULL pointer when there's a failure -during the initialization of the audio system. When this happens, -we shouldn't keep initializing the spice audio channel as if nothing -happened, but just stop the connection. -This can be tested by forcing the "self" variable to NULL in -spice_audio_new -This should fix https://bugzilla.redhat.com/show_bug.cgi?id=772118 ---- - gtk/spice-audio.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/gtk/spice-audio.c b/gtk/spice-audio.c -index f58a81e..3d6e34c 100644 ---- a/gtk/spice-audio.c -+++ b/gtk/spice-audio.c -@@ -221,6 +221,8 @@ SpiceAudio *spice_audio_new(SpiceSession *session, GMainContext *context, - #ifdef WITH_GSTAUDIO - self = SPICE_AUDIO(spice_gstaudio_new(session, context, name)); - #endif -+ if (!self) -+ return NULL; - - spice_g_signal_connect_object(session, "notify::enable-audio", G_CALLBACK(session_enable_audio), self, 0); - spice_g_signal_connect_object(session, "channel-new", G_CALLBACK(channel_new), self, 0); --- -1.7.7.4 - diff --git a/0002-spice-channel-Allow-calling-spice_msg_out_send-from-.patch b/0002-spice-channel-Allow-calling-spice_msg_out_send-from-.patch deleted file mode 100644 index c512854..0000000 --- a/0002-spice-channel-Allow-calling-spice_msg_out_send-from-.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 3cf733aa98df7cdceaf8ac25b25802a606a9d6e6 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 16 Jan 2012 15:28:00 +0100 -Subject: [PATCH spice-gtk 3/3] spice-channel: Allow calling - spice_msg_out_send from any context - -spice_msg_out can be not only called from system context and usb event -handling thread context, but also from co-routine context. Calling from -co-routine context happens when a response gets send synchronously from -the handle_msg handler for a certain received packet. This happens with -certain usbredir commands. - -This triggers the following assert in the coroutine code: -"GSpice-CRITICAL **: g_coroutine_wakeup: assertion `coroutine != - g_coroutine_self()' failed" - -This patch fixes this by making spice_msg_out_send callable from any -context and at the same time changing the code to not do unnecessary -wakeups. - -Signed-off-by: Hans de Goede ---- - gtk/spice-channel-priv.h | 2 +- - gtk/spice-channel.c | 52 ++++++++++++++++++++++++++++++++++----------- - 2 files changed, 40 insertions(+), 14 deletions(-) - -diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h -index ebdc5ce..5cd7ddb 100644 ---- a/gtk/spice-channel-priv.h -+++ b/gtk/spice-channel-priv.h -@@ -102,7 +102,7 @@ struct _SpiceChannelPrivate { - GQueue xmit_queue; - gboolean xmit_queue_blocked; - GStaticMutex xmit_queue_lock; -- GThread *main_thread; -+ guint xmit_queue_wakeup_id; - - char name[16]; - enum spice_channel_state state; -diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c -index 83cd344..bdfb02b 100644 ---- a/gtk/spice-channel.c -+++ b/gtk/spice-channel.c -@@ -110,7 +110,6 @@ static void spice_channel_init(SpiceChannel *channel) - spice_channel_set_common_capability(channel, SPICE_COMMON_CAP_MINI_HEADER); - g_queue_init(&c->xmit_queue); - g_static_mutex_init(&c->xmit_queue_lock); -- c->main_thread = g_thread_self(); - } - - static void spice_channel_constructed(GObject *gobject) -@@ -649,14 +648,32 @@ void spice_msg_out_unref(SpiceMsgOut *out) - static gboolean spice_channel_idle_wakeup(gpointer user_data) - { - SpiceChannel *channel = SPICE_CHANNEL(user_data); -+ SpiceChannelPrivate *c = channel->priv; -+ -+ /* -+ * Note: -+ * -+ * - This must be done before the wakeup as that may eventually -+ * call channel_reset() which checks this. -+ * - The lock calls are really necessary, this fixes the following race: -+ * 1) usb-event-thread calls spice_msg_out_send() -+ * 2) spice_msg_out_send calls g_timeout_add_full(...) -+ * 3) we run, set xmit_queue_wakeup_id to 0 -+ * 4) spice_msg_out_send stores the result of g_timeout_add_full() in -+ * xmit_queue_wakeup_id, overwriting the 0 we just stored -+ * 5) xmit_queue_wakeup_id now says there is a wakeup pending which is -+ * false -+ */ -+ g_static_mutex_lock(&c->xmit_queue_lock); -+ c->xmit_queue_wakeup_id = 0; -+ g_static_mutex_unlock(&c->xmit_queue_lock); - - spice_channel_wakeup(channel, FALSE); -- g_object_unref(channel); - - return FALSE; - } - --/* system context */ -+/* any context (system/co-routine/usb-event-thread) */ - G_GNUC_INTERNAL - void spice_msg_out_send(SpiceMsgOut *out) - { -@@ -664,17 +681,23 @@ void spice_msg_out_send(SpiceMsgOut *out) - g_return_if_fail(out->channel != NULL); - - g_static_mutex_lock(&out->channel->priv->xmit_queue_lock); -- if (!out->channel->priv->xmit_queue_blocked) -+ if (!out->channel->priv->xmit_queue_blocked) { -+ gboolean was_empty; -+ -+ was_empty = g_queue_is_empty(&out->channel->priv->xmit_queue); - g_queue_push_tail(&out->channel->priv->xmit_queue, out); -- g_static_mutex_unlock(&out->channel->priv->xmit_queue_lock); - -- /* TODO: we currently flush/wakeup immediately all buffered messages */ -- if (g_thread_self() != out->channel->priv->main_thread) -- /* We use g_timeout_add_full so that can specify the priority */ -- g_timeout_add_full(G_PRIORITY_HIGH, 0, spice_channel_idle_wakeup, -- g_object_ref(out->channel), NULL); -- else -- spice_channel_wakeup(out->channel, FALSE); -+ /* One wakeup is enough to empty the entire queue -> only do a wakeup -+ if the queue was empty, and there isn't one pending already. */ -+ if (was_empty && !out->channel->priv->xmit_queue_wakeup_id) { -+ out->channel->priv->xmit_queue_wakeup_id = -+ /* Use g_timeout_add_full so that can specify the priority */ -+ g_timeout_add_full(G_PRIORITY_HIGH, 0, -+ spice_channel_idle_wakeup, -+ out->channel, NULL); -+ } -+ } -+ g_static_mutex_unlock(&out->channel->priv->xmit_queue_lock); - } - - /* coroutine context */ -@@ -1688,7 +1711,6 @@ error: - } - - /* system context */ --/* TODO: we currently flush/wakeup immediately all buffered messages */ - G_GNUC_INTERNAL - void spice_channel_wakeup(SpiceChannel *channel, gboolean cancel) - { -@@ -2344,6 +2366,10 @@ static void channel_reset(SpiceChannel *channel, gboolean migrating) - c->xmit_queue_blocked = TRUE; /* Disallow queuing new messages */ - g_queue_foreach(&c->xmit_queue, (GFunc)spice_msg_out_unref, NULL); - g_queue_clear(&c->xmit_queue); -+ if (c->xmit_queue_wakeup_id) { -+ g_source_remove(c->xmit_queue_wakeup_id); -+ c->xmit_queue_wakeup_id = 0; -+ } - g_static_mutex_unlock(&c->xmit_queue_lock); - - g_array_set_size(c->remote_common_caps, 0); --- -1.7.7.4 - diff --git a/sources b/sources index 0001c9e..8528b7a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -761b6c3d74d962d437bdd72f54292498 spice-gtk-0.8.tar.bz2 +29dd7372ac099aedb4d024fc4eacd374 spice-gtk-0.9.tar.bz2 diff --git a/spice-gtk.spec b/spice-gtk.spec index aeeae4f..a5ad439 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -12,7 +12,7 @@ #define _version_suffix -ab64 Name: spice-gtk -Version: 0.8 +Version: 0.9 Release: 1%{?dist} Summary: A GTK+ widget for SPICE clients @@ -20,9 +20,6 @@ Group: System Environment/Libraries License: LGPLv2+ URL: http://spice-space.org/page/Spice-Gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 -# 2 fixes from upstream git -Patch0: 0001-Handle-spice_audio_new-failures.patch -Patch1: 0002-spice-channel-Allow-calling-spice_msg_out_send-from-.patch BuildRequires: intltool BuildRequires: gtk2-devel >= 2.14 @@ -142,11 +139,6 @@ snappy is a tool to capture screen-shots of a SPICE desktop. %prep %setup -q -n spice-gtk-%{version}%{?_version_suffix} -c -pushd spice-gtk-%{version}%{?_version_suffix} -%patch0 -p1 -%patch1 -p1 -popd - if [ -n '%{?_version_suffix}' ]; then mv spice-gtk-%{version}%{?_version_suffix} spice-gtk-%{version} fi @@ -261,6 +253,9 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la %{_bindir}/spicy-stats %changelog +* Mon Jan 30 2012 Hans de Goede - 0.9-1 +- New upstream release 0.9 + * Mon Jan 16 2012 Hans de Goede - 0.8-1 - New upstream release 0.8 - Various small specfile improvements