[Spice-devel] [PATCH 08/18] Name MainChannelClient methods consistently
Frediano Ziglio
fziglio at redhat.com
Thu Apr 28 17:16:15 UTC 2016
>
> Always use main_channel_client_ prefix instead of just main_channel_ in
> some cases.
> ---
> server/main-channel.c | 16 +++++++++-------
> server/main-channel.h | 15 +++++++++------
> server/reds.c | 19 ++++++++++---------
> 3 files changed, 28 insertions(+), 22 deletions(-)
>
> diff --git a/server/main-channel.c b/server/main-channel.c
> index 0daacdc..77014c7 100644
> --- a/server/main-channel.c
> +++ b/server/main-channel.c
> @@ -510,10 +510,12 @@ static int
> main_channel_handle_migrate_data(RedChannelClient *rcc,
> return reds_handle_migrate_data(rcc->channel->reds, mcc,
> (SpiceMigrateDataMain *)(header + 1), size);
> }
>
> -void main_channel_push_init(MainChannelClient *mcc,
> - int display_channels_hint, int current_mouse_mode,
> - int is_client_mouse_allowed, int multi_media_time,
> - int ram_hint)
> +void main_channel_client_push_init(MainChannelClient *mcc,
> + int display_channels_hint,
> + int current_mouse_mode,
> + int is_client_mouse_allowed,
> + int multi_media_time,
> + int ram_hint)
> {
> RedPipeItem *item;
>
> @@ -545,7 +547,7 @@ static void main_channel_marshall_init(RedChannelClient
> *rcc,
> spice_marshall_msg_main_init(m, &init);
> }
>
> -void main_channel_push_name(MainChannelClient *mcc, const char *name)
> +void main_channel_client_push_name(MainChannelClient *mcc, const char *name)
> {
> RedPipeItem *item;
>
> @@ -557,7 +559,7 @@ void main_channel_push_name(MainChannelClient *mcc, const
> char *name)
> red_channel_client_pipe_add_push(&mcc->base, item);
> }
>
> -void main_channel_push_uuid(MainChannelClient *mcc, const uint8_t uuid[16])
> +void main_channel_client_push_uuid(MainChannelClient *mcc, const uint8_t
> uuid[16])
> {
> RedPipeItem *item;
>
> @@ -854,7 +856,7 @@ void
> main_channel_client_handle_migrate_end(MainChannelClient *mcc)
> red_client_semi_seamless_migrate_complete(mcc->base.client);
> }
>
> -void main_channel_migrate_dst_complete(MainChannelClient *mcc)
> +void main_channel_client_migrate_dst_complete(MainChannelClient *mcc)
> {
> if (mcc->mig_wait_prev_complete) {
> if (mcc->mig_wait_prev_try_seamless) {
> diff --git a/server/main-channel.h b/server/main-channel.h
> index fd16c94..34e91b0 100644
> --- a/server/main-channel.h
> +++ b/server/main-channel.h
> @@ -64,9 +64,12 @@ void main_channel_client_push_agent_data(MainChannelClient
> *mcc, uint8_t* data,
> void main_channel_client_start_net_test(MainChannelClient *mcc, int
> test_rate);
> // TODO: huge. Consider making a reds_* interface for these functions
> // and calling from main.
> -void main_channel_push_init(MainChannelClient *mcc, int
> display_channels_hint,
> - int current_mouse_mode, int is_client_mouse_allowed, int
> multi_media_time,
> - int ram_hint);
> +void main_channel_client_push_init(MainChannelClient *mcc,
> + int display_channels_hint,
> + int current_mouse_mode,
> + int is_client_mouse_allowed,
> + int multi_media_time,
> + int ram_hint);
> void main_channel_client_push_notify(MainChannelClient *mcc, const char
> *msg);
> void main_channel_push_multi_media_time(MainChannel *main_chan, int time);
> int main_channel_getsockname(MainChannel *main_chan, struct sockaddr *sa,
> socklen_t *salen);
> @@ -96,8 +99,8 @@ int main_channel_migrate_connect(MainChannel *main_channel,
> RedsMigSpice *mig_ta
> void main_channel_migrate_cancel_wait(MainChannel *main_chan);
> /* returns the number of clients for which SPICE_MSG_MAIN_MIGRATE_END was
> sent*/
> int main_channel_migrate_src_complete(MainChannel *main_chan, int success);
> -void main_channel_migrate_dst_complete(MainChannelClient *mcc);
> -void main_channel_push_name(MainChannelClient *mcc, const char *name);
> -void main_channel_push_uuid(MainChannelClient *mcc, const uint8_t uuid[16]);
> +void main_channel_client_migrate_dst_complete(MainChannelClient *mcc);
> +void main_channel_client_push_name(MainChannelClient *mcc, const char
> *name);
> +void main_channel_client_push_uuid(MainChannelClient *mcc, const uint8_t
> uuid[16]);
>
> #endif
> diff --git a/server/reds.c b/server/reds.c
> index a72afe0..e34e694 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -1825,14 +1825,14 @@ static void reds_handle_main_link(RedsState *reds,
> RedLinkInfo *link)
> }
>
> if (!mig_target) {
> - main_channel_push_init(mcc, g_list_length(reds->qxl_instances),
> + main_channel_client_push_init(mcc,
> g_list_length(reds->qxl_instances),
> reds->mouse_mode, reds->is_client_mouse_allowed,
> reds_get_mm_time() - MM_TIME_DELTA,
> reds_qxl_ram_size(reds));
> if (reds->config->spice_name)
> - main_channel_push_name(mcc, reds->config->spice_name);
> + main_channel_client_push_name(mcc, reds->config->spice_name);
> if (reds->config->spice_uuid_is_set)
> - main_channel_push_uuid(mcc, reds->config->spice_uuid);
> + main_channel_client_push_uuid(mcc, reds->config->spice_uuid);
> } else {
> reds_mig_target_client_add(reds, client);
> }
> @@ -1960,7 +1960,7 @@ void reds_on_client_seamless_migrate_complete(RedsState
> *reds, RedClient *client
> spice_info("client no longer exists");
> return;
> }
> - main_channel_migrate_dst_complete(red_client_get_main(client));
> + main_channel_client_migrate_dst_complete(red_client_get_main(client));
> }
>
> void reds_on_client_semi_seamless_migrate_complete(RedsState *reds,
> RedClient *client)
> @@ -1971,12 +1971,13 @@ void
> reds_on_client_semi_seamless_migrate_complete(RedsState *reds, RedClient *c
> mcc = red_client_get_main(client);
>
> // TODO: not doing net test. consider doing it on client_migrate_info
> - main_channel_push_init(mcc, g_list_length(reds->qxl_instances),
> - reds->mouse_mode, reds->is_client_mouse_allowed,
> - reds_get_mm_time() - MM_TIME_DELTA,
> - reds_qxl_ram_size(reds));
> + main_channel_client_push_init(mcc, g_list_length(reds->qxl_instances),
> + reds->mouse_mode,
> + reds->is_client_mouse_allowed,
> + reds_get_mm_time() - MM_TIME_DELTA,
> + reds_qxl_ram_size(reds));
> reds_link_mig_target_channels(reds, client);
> - main_channel_migrate_dst_complete(mcc);
> + main_channel_client_migrate_dst_complete(mcc);
> }
>
> static void reds_handle_other_links(RedsState *reds, RedLinkInfo *link)
Acked-by: Frediano Ziglio <fziglio at redhat.com>
Frediano
More information about the Spice-devel
mailing list