> From: Jonathon Jongsma <jjongsma@xxxxxxxxxx> > > In preparation for getting rid of the global 'reds' variable, we need to > pass the RedsState variable to all functions where it is needed. For now > the callers just pass in the global reds variable. > --- > server/inputs-channel.c | 2 +- > server/red-dispatcher.c | 4 ++-- > server/reds.c | 2 +- > server/reds.h | 2 +- > server/smartcard.c | 2 +- > server/sound.c | 4 ++-- > server/spicevmc.c | 2 +- > 7 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/server/inputs-channel.c b/server/inputs-channel.c > index c21cab8..5ab76cb 100644 > --- a/server/inputs-channel.c > +++ b/server/inputs-channel.c > @@ -672,7 +672,7 @@ void inputs_init(void) > red_channel_register_client_cbs(&g_inputs_channel->base, &client_cbs); > > red_channel_set_cap(&g_inputs_channel->base, > SPICE_INPUTS_CAP_KEY_SCANCODE); > - reds_register_channel(&g_inputs_channel->base); > + reds_register_channel(reds, &g_inputs_channel->base); > > if (!(key_modifiers_timer = core->timer_add(core, key_modifiers_sender, > NULL))) { > spice_error("key modifiers timer create failed"); > diff --git a/server/red-dispatcher.c b/server/red-dispatcher.c > index 0810798..dc958d9 100644 > --- a/server/red-dispatcher.c > +++ b/server/red-dispatcher.c > @@ -1044,7 +1044,7 @@ void red_dispatcher_init(QXLInstance *qxl) > client_cbs.migrate = red_dispatcher_cursor_migrate; > red_channel_register_client_cbs(channel, &client_cbs); > red_channel_set_data(channel, red_dispatcher); > - reds_register_channel(channel); > + reds_register_channel(reds, channel); > > channel = red_worker_get_display_channel(worker); > client_cbs.connect = red_dispatcher_set_display_peer; > @@ -1055,7 +1055,7 @@ void red_dispatcher_init(QXLInstance *qxl) > red_channel_set_cap(channel, SPICE_DISPLAY_CAP_MONITORS_CONFIG); > red_channel_set_cap(channel, SPICE_DISPLAY_CAP_PREF_COMPRESSION); > red_channel_set_cap(channel, SPICE_DISPLAY_CAP_STREAM_REPORT); > - reds_register_channel(channel); > + reds_register_channel(reds, channel); > > red_worker_run(worker); > num_active_workers = 1; > diff --git a/server/reds.c b/server/reds.c > index 1b877aa..c5b8c6b 100644 > --- a/server/reds.c > +++ b/server/reds.c > @@ -376,7 +376,7 @@ void reds_update_stat_value(uint32_t value) > > #endif > > -void reds_register_channel(RedChannel *channel) > +void reds_register_channel(RedsState *reds, RedChannel *channel) > { > spice_assert(reds); > ring_add(&reds->channels, &channel->link); > diff --git a/server/reds.h b/server/reds.h > index 8e6e136..8850bc0 100644 > --- a/server/reds.h > +++ b/server/reds.h > @@ -55,7 +55,7 @@ void reds_enable_mm_time(void); > uint32_t reds_get_mm_time(void); > void reds_set_client_mouse_allowed(int is_client_mouse_allowed, > int x_res, int y_res); > -void reds_register_channel(RedChannel *channel); > +void reds_register_channel(RedsState *reds, RedChannel *channel); > void reds_unregister_channel(RedChannel *channel); > int reds_get_mouse_mode(void); // used by inputs_channel > int reds_get_agent_mouse(void); // used by inputs_channel > diff --git a/server/smartcard.c b/server/smartcard.c > index 15ebcc9..9b8f7c6 100644 > --- a/server/smartcard.c > +++ b/server/smartcard.c > @@ -861,5 +861,5 @@ static void smartcard_init(void) > client_cbs.connect = smartcard_connect_client; > red_channel_register_client_cbs(&g_smartcard_channel->base, > &client_cbs); > > - reds_register_channel(&g_smartcard_channel->base); > + reds_register_channel(reds, &g_smartcard_channel->base); > } > diff --git a/server/sound.c b/server/sound.c > index adb27ca..388bc5e 100644 > --- a/server/sound.c > +++ b/server/sound.c > @@ -1533,7 +1533,7 @@ void snd_attach_playback(SpicePlaybackInstance *sin) > > playback_worker->base_channel = channel; > add_worker(playback_worker); > - reds_register_channel(channel); > + reds_register_channel(reds, channel); > } > > void snd_attach_record(SpiceRecordInstance *sin) > @@ -1561,7 +1561,7 @@ void snd_attach_record(SpiceRecordInstance *sin) > > record_worker->base_channel = channel; > add_worker(record_worker); > - reds_register_channel(channel); > + reds_register_channel(reds, channel); > } > > static void snd_detach_common(SndWorker *worker) > diff --git a/server/spicevmc.c b/server/spicevmc.c > index 115c3b1..9916278 100644 > --- a/server/spicevmc.c > +++ b/server/spicevmc.c > @@ -548,7 +548,7 @@ SpiceCharDeviceState > *spicevmc_device_connect(SpiceCharDeviceInstance *sin, > state); > state->chardev_sin = sin; > > - reds_register_channel(&state->channel); > + reds_register_channel(reds, &state->channel); > return state->chardev_st; > } > Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx> Frediano _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel