Make cursor_channel_disconnect a CursorChannel method

The first argument should be CursorChannel* rather than RedChannel*
since it's essentially a CursorChannel method.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Marc-André Lureau 2015-10-30 11:08:25 -05:00 committed by Frediano Ziglio
parent f2c8609985
commit 2d934ed82e
3 changed files with 5 additions and 3 deletions

View File

@ -135,8 +135,10 @@ static void red_reset_cursor_cache(RedChannelClient *rcc)
red_cursor_cache_reset(RCC_TO_CCC(rcc), CLIENT_CURSOR_CACHE_SIZE);
}
void cursor_channel_disconnect(RedChannel *channel)
void cursor_channel_disconnect(CursorChannel *cursor_channel)
{
RedChannel *channel = (RedChannel *)cursor_channel;
if (!channel || !red_channel_is_connected(channel)) {
return;
}

View File

@ -78,7 +78,7 @@ typedef struct CursorChannel {
G_STATIC_ASSERT(sizeof(CursorItem) <= QXL_CURSUR_DEVICE_DATA_SIZE);
CursorChannel* cursor_channel_new (RedWorker *worker);
void cursor_channel_disconnect (RedChannel *channel);
void cursor_channel_disconnect (CursorChannel *cursor_channel);
void cursor_channel_reset (CursorChannel *cursor);
void cursor_channel_process_cmd (CursorChannel *cursor, RedCursorCmd *cursor_cmd,
uint32_t group_id);

View File

@ -8828,7 +8828,7 @@ static inline void flush_cursor_commands(RedWorker *worker)
red_channel_send(channel);
if (red_get_monotonic_time() >= end_time) {
spice_warning("flush cursor timeout");
cursor_channel_disconnect(channel);
cursor_channel_disconnect(worker->cursor_channel);
worker->cursor_channel = NULL;
} else {
sleep_count++;