summaryrefslogtreecommitdiffstats
path: root/server/red-channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/red-channel.c')
-rw-r--r--server/red-channel.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/server/red-channel.c b/server/red-channel.c
index c0a5b42c..646b000b 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -1016,6 +1016,7 @@ void red_channel_client_default_migrate(RedChannelClient *rcc)
}
RedChannel *red_channel_create(int size,
+ RedsState *reds,
const SpiceCoreInterface *core,
uint32_t type, uint32_t id,
int handle_acks,
@@ -1039,6 +1040,7 @@ RedChannel *red_channel_create(int size,
channel->migration_flags = migration_flags;
memcpy(&channel->channel_cbs, channel_cbs, sizeof(ChannelCbs));
+ channel->reds = reds;
channel->core = core;
ring_init(&channel->clients);
@@ -1094,7 +1096,7 @@ SpiceCoreInterface dummy_core = {
.watch_remove = dummy_watch_remove,
};
-RedChannel *red_channel_create_dummy(int size, uint32_t type, uint32_t id)
+RedChannel *red_channel_create_dummy(int size, RedsState *reds, uint32_t type, uint32_t id)
{
RedChannel *channel;
ClientCbs client_cbs = { NULL, };
@@ -1104,6 +1106,7 @@ RedChannel *red_channel_create_dummy(int size, uint32_t type, uint32_t id)
channel->type = type;
channel->id = id;
channel->refs = 1;
+ channel->reds = reds;
channel->core = &dummy_core;
ring_init(&channel->clients);
client_cbs.connect = red_channel_client_default_connect;
@@ -1131,15 +1134,16 @@ static int do_nothing_handle_message(RedChannelClient *rcc,
}
RedChannel *red_channel_create_parser(int size,
- const SpiceCoreInterface *core,
- uint32_t type, uint32_t id,
- int handle_acks,
- spice_parse_channel_func_t parser,
- channel_handle_parsed_proc handle_parsed,
- ChannelCbs *channel_cbs,
- uint32_t migration_flags)
-{
- RedChannel *channel = red_channel_create(size, core, type, id,
+ RedsState *reds,
+ const SpiceCoreInterface *core,
+ uint32_t type, uint32_t id,
+ int handle_acks,
+ spice_parse_channel_func_t parser,
+ channel_handle_parsed_proc handle_parsed,
+ ChannelCbs *channel_cbs,
+ uint32_t migration_flags)
+{
+ RedChannel *channel = red_channel_create(size, reds, core, type, id,
handle_acks,
do_nothing_handle_message,
channel_cbs,
@@ -1161,7 +1165,7 @@ void red_channel_set_stat_node(RedChannel *channel, StatNodeRef stat)
#ifdef RED_STATISTICS
channel->stat = stat;
- channel->out_bytes_counter = reds_stat_add_counter(reds, stat, "out_bytes", TRUE);
+ channel->out_bytes_counter = reds_stat_add_counter(channel->reds, stat, "out_bytes", TRUE);
#endif
}