summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-01-16 15:07:34 -0600
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:42 +0100
commitddc34a91dbe6893661e7d293a24b3c99bd4b2024 (patch)
tree37490ea28fdd70810afa587cba2f1e3370ee25d2
parent06d1dfaf2245b1dd05abb13f7eb0a7d3a36be008 (diff)
downloadspice-ddc34a91dbe6893661e7d293a24b3c99bd4b2024.tar.gz
spice-ddc34a91dbe6893661e7d293a24b3c99bd4b2024.tar.xz
spice-ddc34a91dbe6893661e7d293a24b3c99bd4b2024.zip
Change reds_num_of_channels() to take RedsState arg
-rw-r--r--server/main-channel.c2
-rw-r--r--server/reds.c2
-rw-r--r--server/reds.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/server/main-channel.c b/server/main-channel.c
index 0a4810d8..fe2a273f 100644
--- a/server/main-channel.c
+++ b/server/main-channel.c
@@ -353,7 +353,7 @@ static void main_channel_marshall_channels(RedChannelClient *rcc,
red_channel_client_init_send_data(rcc, SPICE_MSG_MAIN_CHANNELS_LIST, item);
channels_info = (SpiceMsgChannels *)spice_malloc(sizeof(SpiceMsgChannels)
- + reds_num_of_channels() * sizeof(SpiceChannelId));
+ + reds_num_of_channels(reds) * sizeof(SpiceChannelId));
reds_fill_channels(channels_info);
spice_marshall_msg_main_channels_list(m, channels_info);
free(channels_info);
diff --git a/server/reds.c b/server/reds.c
index 3ed91bd8..09decbfb 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -836,7 +836,7 @@ void reds_handle_agent_mouse_event(RedsState *reds, const VDAgentMouseState *mou
spice_char_device_write_buffer_add(reds->agent_state.base, char_dev_buf);
}
-int reds_num_of_channels(void)
+int reds_num_of_channels(RedsState *reds)
{
return reds ? reds->num_of_channels : 0;
}
diff --git a/server/reds.h b/server/reds.h
index b59ebf2d..a1cefba9 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -89,7 +89,7 @@ void reds_client_disconnect(RedsState *reds, RedClient *client);
typedef struct MainMigrateData MainMigrateData;
void reds_marshall_migrate_data(SpiceMarshaller *m);
void reds_fill_channels(SpiceMsgChannels *channels_info);
-int reds_num_of_channels(void);
+int reds_num_of_channels(RedsState *reds);
int reds_num_of_clients(void);
#ifdef RED_STATISTICS
void reds_update_stat_value(uint32_t value);