From eef8d0d8a3475fc31a087125ccbecea674518d5f Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Fri, 6 May 2016 22:01:24 +0100 Subject: [PATCH] move during_target_migrate out of common_graphics_channel_new_client This reduces the number of arguments that need to be passed to the function, and also avoids changing a different object within a function that is supposed to just create a new object Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/cursor-channel.c | 2 +- server/dcc.c | 3 ++- server/red-worker.c | 2 -- server/red-worker.h | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/server/cursor-channel.c b/server/cursor-channel.c index 76499049..2621c5fc 100644 --- a/server/cursor-channel.c +++ b/server/cursor-channel.c @@ -390,13 +390,13 @@ static CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor, (CursorChannelClient*)common_graphics_channel_new_client(&cursor->common, sizeof(CursorChannelClient), client, stream, - mig_target, FALSE, common_caps, num_common_caps, caps, num_caps); spice_return_val_if_fail(ccc != NULL, NULL); + cursor->common.during_target_migrate = mig_target; ring_init(&ccc->cursor_cache_lru); ccc->cursor_cache_available = CLIENT_CURSOR_CACHE_SIZE; diff --git a/server/dcc.c b/server/dcc.c index c1c30c68..81ae4ed2 100644 --- a/server/dcc.c +++ b/server/dcc.c @@ -366,9 +366,10 @@ DisplayChannelClient *dcc_new(DisplayChannel *display, dcc = (DisplayChannelClient*)common_graphics_channel_new_client( COMMON_GRAPHICS_CHANNEL(display), sizeof(DisplayChannelClient), - client, stream, mig_target, TRUE, + client, stream, TRUE, common_caps, num_common_caps, caps, num_caps); + display->common.during_target_migrate = mig_target; dcc->id = display->common.qxl->id; spice_return_val_if_fail(dcc, NULL); spice_info("New display (client %p) dcc %p stream %p", client, dcc, stream); diff --git a/server/red-worker.c b/server/red-worker.c index f15f67a8..8f9c8dd6 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -445,7 +445,6 @@ CommonGraphicsChannelClient *common_graphics_channel_new_client(CommonGraphicsCh int size, RedClient *client, RedsStream *stream, - int mig_target, int monitor_latency, uint32_t *common_caps, int num_common_caps, @@ -458,7 +457,6 @@ CommonGraphicsChannelClient *common_graphics_channel_new_client(CommonGraphicsCh if (!rcc) { return NULL; } - common->during_target_migrate = mig_target; return (CommonGraphicsChannelClient*)rcc; } diff --git a/server/red-worker.h b/server/red-worker.h index 63be8b53..318a0049 100644 --- a/server/red-worker.h +++ b/server/red-worker.h @@ -104,7 +104,6 @@ CommonGraphicsChannelClient *common_graphics_channel_new_client(CommonGraphicsCh int size, RedClient *client, RedsStream *stream, - int mig_target, int monitor_latency, uint32_t *common_caps, int num_common_caps,