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