Blame SOURCES/0007-channel-usbredir-Chain-up-with-parent-s-channel-rese.patch

39a9e2
From 5132d4672c65129841869da897d087c721beab28 Mon Sep 17 00:00:00 2001
39a9e2
From: Victor Toso <me@victortoso.com>
39a9e2
Date: Wed, 5 Sep 2018 15:43:28 +0200
39a9e2
Subject: [PATCH] channel-usbredir: Chain-up with parent's channel-reset
39a9e2
39a9e2
Otherwise spice-channel is left with a broken state.
39a9e2
39a9e2
This code moves parent's call to channel_reset() into
39a9e2
_channel_reset_finish() - Note that spice-channel's channel_reset()
39a9e2
can be called from GMainContext.
39a9e2
39a9e2
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1625550
39a9e2
39a9e2
Signed-off-by: Victor Toso <victortoso@redhat.com>
39a9e2
Acked-by: Frediano Ziglio <fziglio@redhat.com>
39a9e2
(cherry picked from commit 3afee7ae8db387e7f4339f2a4afaa63babf358b7)
39a9e2
---
39a9e2
 src/channel-usbredir.c | 11 +++++------
39a9e2
 1 file changed, 5 insertions(+), 6 deletions(-)
39a9e2
39a9e2
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
39a9e2
index 13927cc..870938b 100644
39a9e2
--- a/src/channel-usbredir.c
39a9e2
+++ b/src/channel-usbredir.c
39a9e2
@@ -122,7 +122,7 @@ static void spice_usbredir_channel_init(SpiceUsbredirChannel *channel)
39a9e2
 
39a9e2
 #ifdef USE_USBREDIR
39a9e2
 
39a9e2
-static void _channel_reset_finish(SpiceUsbredirChannel *channel)
39a9e2
+static void _channel_reset_finish(SpiceUsbredirChannel *channel, gboolean migrating)
39a9e2
 {
39a9e2
     SpiceUsbredirChannelPrivate *priv = channel->priv;
39a9e2
 
39a9e2
@@ -135,6 +135,8 @@ static void _channel_reset_finish(SpiceUsbredirChannel *channel)
39a9e2
     spice_usbredir_channel_set_context(channel, priv->context);
39a9e2
 
39a9e2
     spice_usbredir_channel_unlock(channel);
39a9e2
+
39a9e2
+    SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(SPICE_CHANNEL(channel), migrating);
39a9e2
 }
39a9e2
 
39a9e2
 static void _channel_reset_cb(GObject *gobject,
39a9e2
@@ -146,9 +148,7 @@ static void _channel_reset_cb(GObject *gobject,
39a9e2
     gboolean migrating = GPOINTER_TO_UINT(user_data);
39a9e2
     GError *err = NULL;
39a9e2
 
39a9e2
-    _channel_reset_finish(channel);
39a9e2
-
39a9e2
-    SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(spice_channel, migrating);
39a9e2
+    _channel_reset_finish(channel, migrating);
39a9e2
 
39a9e2
     spice_usbredir_channel_disconnect_device_finish(channel, result, &err;;
39a9e2
 }
39a9e2
@@ -177,8 +177,7 @@ static void spice_usbredir_channel_reset(SpiceChannel *c, gboolean migrating)
39a9e2
         return;
39a9e2
     }
39a9e2
 
39a9e2
-    /* FIXME: This does not chain-up with parent's channel-reset, which is a must */
39a9e2
-    _channel_reset_finish(channel);
39a9e2
+    _channel_reset_finish(channel, migrating);
39a9e2
 }
39a9e2
 #endif
39a9e2
 
39a9e2
-- 
39a9e2
2.20.1
39a9e2