[Spice-commits] 2 commits - server/inputs-channel.c server/inputs-channel.h server/reds.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Fri Feb 12 15:34:20 UTC 2016


 server/inputs-channel.c |    5 +++--
 server/inputs-channel.h |    2 +-
 server/reds.c           |   10 +++++-----
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 8b24bed2209e72afec2279784fc981135817ba00
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Tue Feb 3 10:59:39 2015 -0600

    Add RedsState arg to reds_set_migration_dest_info()
    
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 84e28fc..e78eece 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3834,7 +3834,8 @@ SPICE_GNUC_VISIBLE int spice_server_set_agent_file_xfer(SpiceServer *s, int enab
 }
 
 /* returns FALSE if info is invalid */
-static int reds_set_migration_dest_info(const char* dest,
+static int reds_set_migration_dest_info(RedsState *reds,
+                                        const char* dest,
                                         int port, int secure_port,
                                         const char* cert_subject)
 {
@@ -3877,7 +3878,7 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_connect(SpiceServer *s, const char*
 
     sif = SPICE_CONTAINEROF(s->migration_interface->base.sif, SpiceMigrateInterface, base);
 
-    if (!reds_set_migration_dest_info(dest, port, secure_port, cert_subject)) {
+    if (!reds_set_migration_dest_info(reds, dest, port, secure_port, cert_subject)) {
         sif->migrate_connect_complete(s->migration_interface);
         return -1;
     }
@@ -3916,9 +3917,8 @@ SPICE_GNUC_VISIBLE int spice_server_migrate_info(SpiceServer *s, const char* des
 {
     spice_info(NULL);
     spice_assert(!s->migration_interface);
-    spice_assert(reds == s);
 
-    if (!reds_set_migration_dest_info(dest, port, secure_port, cert_subject)) {
+    if (!reds_set_migration_dest_info(reds, dest, port, secure_port, cert_subject)) {
         return -1;
     }
     return 0;
commit 36b073519245ef209265d7d601337f670dddcc1f
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date:   Mon Feb 2 13:58:36 2015 -0600

    Add RedsState arg to inputs_channel_new()
    
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/inputs-channel.c b/server/inputs-channel.c
index 71716d5..bb1c5ea 100644
--- a/server/inputs-channel.c
+++ b/server/inputs-channel.c
@@ -305,6 +305,7 @@ static int inputs_channel_handle_parsed(RedChannelClient *rcc, uint32_t size, ui
     InputsChannel *inputs_channel = (InputsChannel *)rcc->channel;
     InputsChannelClient *icc = (InputsChannelClient *)rcc;
     uint32_t i;
+    RedsState *reds = inputs_channel->base.reds;
 
     switch (type) {
     case SPICE_MSGC_INPUTS_KEY_DOWN: {
@@ -618,7 +619,7 @@ static int inputs_channel_handle_migrate_data(RedChannelClient *rcc,
     return TRUE;
 }
 
-InputsChannel* inputs_channel_new(void)
+InputsChannel* inputs_channel_new(RedsState *reds)
 {
     ChannelCbs channel_cbs = { NULL, };
     ClientCbs client_cbs = { NULL, };
@@ -675,7 +676,7 @@ int inputs_channel_set_keyboard(InputsChannel *inputs, SpiceKbdInstance *keyboar
         return -1;
     }
     inputs->keyboard = keyboard;
-    inputs->keyboard->st = spice_kbd_state_new(reds);
+    inputs->keyboard->st = spice_kbd_state_new(inputs->base.reds);
     return 0;
 }
 
diff --git a/server/inputs-channel.h b/server/inputs-channel.h
index 4070a23..fce757f 100644
--- a/server/inputs-channel.h
+++ b/server/inputs-channel.h
@@ -26,7 +26,7 @@
 
 typedef struct InputsChannel InputsChannel;
 
-InputsChannel* inputs_channel_new(void);
+InputsChannel* inputs_channel_new(RedsState *reds);
 const VDAgentMouseState *inputs_channel_get_mouse_state(InputsChannel *inputs);
 void inputs_channel_on_keyboard_leds_change(InputsChannel *inputs, uint8_t leds);
 void inputs_channel_set_tablet_logical_size(InputsChannel *inputs, int x_res, int y_res);
diff --git a/server/reds.c b/server/reds.c
index 4526fae..84e28fc 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3385,7 +3385,7 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
 #endif
 
     reds->main_channel = main_channel_new();
-    reds->inputs_channel = inputs_channel_new();
+    reds->inputs_channel = inputs_channel_new(reds);
 
     reds->mouse_mode = SPICE_MOUSE_MODE_SERVER;
 


More information about the Spice-commits mailing list