[Spice-commits] 2 commits - server/main-dispatcher.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Mar 20 20:41:31 UTC 2019
server/main-dispatcher.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
New commits:
commit d071944043d0d740c71b7f5349437df1e8939c17
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Mar 19 23:47:35 2019 +0000
main-dispatcher: Use reds as opaque for dispatcher
No reason to pass through MainDispatcher, the purpose of
MainDispatcher is to call reds functions from the right thread.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c
index 0dcfb2d4..839e7242 100644
--- a/server/main-dispatcher.c
+++ b/server/main-dispatcher.c
@@ -152,10 +152,10 @@ typedef struct MainDispatcherClientDisconnectMessage {
static void main_dispatcher_handle_channel_event(void *opaque,
void *payload)
{
- MainDispatcher *self = opaque;
+ RedsState *reds = opaque;
MainDispatcherChannelEventMessage *channel_event = payload;
- reds_handle_channel_event(self->priv->reds, channel_event->event, channel_event->info);
+ reds_handle_channel_event(reds, channel_event->event, channel_event->info);
}
void main_dispatcher_channel_event(MainDispatcher *self, int event, SpiceChannelEventInfo *info)
@@ -176,30 +176,30 @@ void main_dispatcher_channel_event(MainDispatcher *self, int event, SpiceChannel
static void main_dispatcher_handle_migrate_complete(void *opaque,
void *payload)
{
- MainDispatcher *self = opaque;
+ RedsState *reds = opaque;
MainDispatcherMigrateSeamlessDstCompleteMessage *mig_complete = payload;
- reds_on_client_seamless_migrate_complete(self->priv->reds, mig_complete->client);
+ reds_on_client_seamless_migrate_complete(reds, mig_complete->client);
g_object_unref(mig_complete->client);
}
static void main_dispatcher_handle_mm_time_latency(void *opaque,
void *payload)
{
- MainDispatcher *self = opaque;
+ RedsState *reds = opaque;
MainDispatcherMmTimeLatencyMessage *msg = payload;
- reds_set_client_mm_time_latency(self->priv->reds, msg->client, msg->latency);
+ reds_set_client_mm_time_latency(reds, msg->client, msg->latency);
g_object_unref(msg->client);
}
static void main_dispatcher_handle_client_disconnect(void *opaque,
void *payload)
{
- MainDispatcher *self = opaque;
+ RedsState *reds = opaque;
MainDispatcherClientDisconnectMessage *msg = payload;
spice_debug("client=%p", msg->client);
- reds_client_disconnect(self->priv->reds, msg->client);
+ reds_client_disconnect(reds, msg->client);
g_object_unref(msg->client);
}
@@ -273,7 +273,7 @@ void main_dispatcher_constructed(GObject *object)
MainDispatcher *self = MAIN_DISPATCHER(object);
G_OBJECT_CLASS(main_dispatcher_parent_class)->constructed(object);
- dispatcher_set_opaque(DISPATCHER(self), self);
+ dispatcher_set_opaque(DISPATCHER(self), self->priv->reds);
self->priv->watch =
reds_core_watch_add(self->priv->reds,
commit fe4662a99a90343ee9bdf230cd2f28b6b09e0ebb
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Tue Mar 19 23:44:21 2019 +0000
main-dispatcher: Inline main_dispatcher_self_handle_channel_event
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c
index 82b25e6e..0dcfb2d4 100644
--- a/server/main-dispatcher.c
+++ b/server/main-dispatcher.c
@@ -149,22 +149,13 @@ typedef struct MainDispatcherClientDisconnectMessage {
} MainDispatcherClientDisconnectMessage;
/* channel_event - calls core->channel_event, must be done in main thread */
-static void main_dispatcher_self_handle_channel_event(MainDispatcher *self,
- int event,
- SpiceChannelEventInfo *info)
-{
- reds_handle_channel_event(self->priv->reds, event, info);
-}
-
static void main_dispatcher_handle_channel_event(void *opaque,
void *payload)
{
MainDispatcher *self = opaque;
MainDispatcherChannelEventMessage *channel_event = payload;
- main_dispatcher_self_handle_channel_event(self,
- channel_event->event,
- channel_event->info);
+ reds_handle_channel_event(self->priv->reds, channel_event->event, channel_event->info);
}
void main_dispatcher_channel_event(MainDispatcher *self, int event, SpiceChannelEventInfo *info)
@@ -172,7 +163,7 @@ void main_dispatcher_channel_event(MainDispatcher *self, int event, SpiceChannel
MainDispatcherChannelEventMessage msg = {0,};
if (pthread_self() == dispatcher_get_thread_id(DISPATCHER(self))) {
- main_dispatcher_self_handle_channel_event(self, event, info);
+ reds_handle_channel_event(self->priv->reds, event, info);
return;
}
msg.event = event;
More information about the Spice-commits
mailing list