[Spice-devel] [PATCH 3/9] move during_target_migrate out of common_graphics_channel_new_client

Jonathon Jongsma jjongsma at redhat.com
Thu Aug 4 21:17:32 UTC 2016


From: Frediano Ziglio <fziglio at redhat.com>

This reduce function and void to change an object in a function
which is supposed just to create a new object

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 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 7649904..2621c5f 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 c1c30c6..81ae4ed 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 f15f67a..8f9c8dd 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 63be8b5..318a004 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,
-- 
2.7.4



More information about the Spice-devel mailing list