[Spice-devel] [PATCH] avoid getting channel from client

Frediano Ziglio fziglio at redhat.com
Wed May 25 11:58:48 UTC 2016


---
 server/inputs-channel-client.c | 2 --
 server/inputs-channel.c        | 7 +------
 server/inputs-channel.h        | 1 -
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/server/inputs-channel-client.c b/server/inputs-channel-client.c
index f9dd6b2..2f8acec 100644
--- a/server/inputs-channel-client.c
+++ b/server/inputs-channel-client.c
@@ -54,9 +54,7 @@ void inputs_channel_client_send_migrate_data(RedChannelClient *rcc,
                                              RedPipeItem *item)
 {
     InputsChannelClient *icc = SPICE_CONTAINEROF(rcc, InputsChannelClient, base);
-    InputsChannel *inputs = (InputsChannel*)rcc->channel;
 
-    inputs_channel_set_src_during_migrate(inputs, FALSE);
     red_channel_client_init_send_data(rcc, SPICE_MSG_MIGRATE_DATA, item);
 
     spice_marshaller_add_uint32(m, SPICE_MIGRATE_DATA_INPUTS_MAGIC);
diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index bdb8d6f..2481b88 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -257,6 +257,7 @@ static void inputs_channel_send_item(RedChannelClient *rcc, RedPipeItem *base)
             red_channel_client_init_send_data(rcc, SPICE_MSG_INPUTS_MOUSE_MOTION_ACK, base);
             break;
         case RED_PIPE_ITEM_MIGRATE_DATA:
+            ((InputsChannel*)rcc->channel)->src_during_migrate = FALSE;
             inputs_channel_client_send_migrate_data(rcc, m, base);
             break;
         default:
@@ -669,9 +670,3 @@ gboolean inputs_channel_is_src_during_migrate(InputsChannel *inputs)
 {
     return inputs->src_during_migrate;
 }
-
-void inputs_channel_set_src_during_migrate(InputsChannel *inputs,
-                                           gboolean value)
-{
-    inputs->src_during_migrate = value;
-}
diff --git a/server/inputs-channel.h b/server/inputs-channel.h
index 5b12fad..6b7509c 100644
--- a/server/inputs-channel.h
+++ b/server/inputs-channel.h
@@ -44,6 +44,5 @@ void inputs_channel_detach_tablet(InputsChannel *inputs, SpiceTabletInstance *ta
 RedsState* spice_tablet_state_get_server(SpiceTabletState *dev);
 RedsState* spice_kbd_state_get_server(SpiceKbdState *dev);
 gboolean inputs_channel_is_src_during_migrate(InputsChannel *inputs);
-void inputs_channel_set_src_during_migrate(InputsChannel *inputs, gboolean value);
 
 #endif
-- 
2.7.4



More information about the Spice-devel mailing list