red_channel: remove unused migrate flag from RedChannel

The relevant flags reside in RedChannelClient and RedClient
This commit is contained in:
Yonit Halperin 2012-08-06 13:35:19 +03:00
parent 934fb14ccc
commit 26027036c0
8 changed files with 12 additions and 22 deletions

View File

@ -539,7 +539,6 @@ void inputs_init(void)
sizeof(InputsChannel),
core,
SPICE_CHANNEL_INPUTS, 0,
FALSE, // TODO: set migration?
FALSE, /* handle_acks */
spice_get_client_channel_parser(SPICE_CHANNEL_INPUTS, NULL),
inputs_channel_handle_parsed,

View File

@ -1172,7 +1172,7 @@ MainChannel* main_channel_init(void)
// TODO: set the migration flag of the channel
channel = red_channel_create_parser(sizeof(MainChannel), core,
SPICE_CHANNEL_MAIN, 0,
FALSE, FALSE, /* handle_acks */
FALSE, /* handle_acks */
spice_get_client_channel_parser(SPICE_CHANNEL_MAIN, NULL),
main_channel_handle_parsed,
&channel_cbs,

View File

@ -768,7 +768,7 @@ void red_channel_client_default_migrate(RedChannelClient *rcc)
RedChannel *red_channel_create(int size,
SpiceCoreInterface *core,
uint32_t type, uint32_t id,
int migrate, int handle_acks,
int handle_acks,
channel_handle_message_proc handle_message,
ChannelCbs *channel_cbs,
uint32_t migration_flags)
@ -790,7 +790,6 @@ RedChannel *red_channel_create(int size,
memcpy(&channel->channel_cbs, channel_cbs, sizeof(ChannelCbs));
channel->core = core;
channel->migrate = migrate;
ring_init(&channel->clients);
// TODO: send incoming_cb as parameters instead of duplicating?
@ -879,14 +878,14 @@ static int do_nothing_handle_message(RedChannelClient *rcc,
RedChannel *red_channel_create_parser(int size,
SpiceCoreInterface *core,
uint32_t type, uint32_t id,
int migrate, int handle_acks,
int handle_acks,
spice_parse_channel_func_t parser,
channel_handle_parsed_proc handle_parsed,
ChannelCbs *channel_cbs,
uint32_t migration_flags)
{
RedChannel *channel = red_channel_create(size, core, type, id,
migrate, handle_acks,
handle_acks,
do_nothing_handle_message,
channel_cbs,
migration_flags);

View File

@ -284,7 +284,6 @@ struct RedChannel {
RingItem link; // channels link for reds
SpiceCoreInterface *core;
int migrate;
int handle_acks;
// RedChannel will hold only connected channel clients (logic - when pushing pipe item to all channel clients, there
@ -320,7 +319,7 @@ struct RedChannel {
RedChannel *red_channel_create(int size,
SpiceCoreInterface *core,
uint32_t type, uint32_t id,
int migrate, int handle_acks,
int handle_acks,
channel_handle_message_proc handle_message,
ChannelCbs *channel_cbs,
uint32_t migration_flags);
@ -330,7 +329,7 @@ RedChannel *red_channel_create(int size,
RedChannel *red_channel_create_parser(int size,
SpiceCoreInterface *core,
uint32_t type, uint32_t id,
int migrate, int handle_acks,
int handle_acks,
spice_parse_channel_func_t parser,
channel_handle_parsed_proc handle_parsed,
ChannelCbs *channel_cbs,

View File

@ -10076,7 +10076,7 @@ CursorChannelClient *cursor_channel_create_rcc(CommonChannel *common,
return ccc;
}
static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_type, int migrate,
static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_type,
int migration_flags,
channel_disconnect_proc on_disconnect,
channel_send_pipe_item_proc send_item,
@ -10104,7 +10104,6 @@ static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_t
channel = red_channel_create_parser(size, &worker_core,
channel_type, worker->id,
migrate,
TRUE /* handle_acks */,
spice_get_client_channel_parser(channel_type, NULL),
handle_parsed,
@ -10265,7 +10264,7 @@ static void display_channel_create(RedWorker *worker, int migrate)
spice_info("create display channel");
if (!(worker->display_channel = (DisplayChannel *)__new_channel(
worker, sizeof(*display_channel),
SPICE_CHANNEL_DISPLAY, migrate,
SPICE_CHANNEL_DISPLAY,
SPICE_MIGRATE_NEED_FLUSH | SPICE_MIGRATE_NEED_DATA_TRANSFER,
display_channel_client_on_disconnect,
display_channel_send_item,
@ -10470,7 +10469,7 @@ static void cursor_channel_create(RedWorker *worker, int migrate)
spice_info("create cursor channel");
worker->cursor_channel = (CursorChannel *)__new_channel(
worker, sizeof(*worker->cursor_channel),
SPICE_CHANNEL_CURSOR, migrate,
SPICE_CHANNEL_CURSOR,
0,
cursor_channel_client_on_disconnect,
cursor_channel_send_item,

View File

@ -842,7 +842,6 @@ static void smartcard_init(void)
g_smartcard_channel = (SmartCardChannel*)red_channel_create(sizeof(SmartCardChannel),
core, SPICE_CHANNEL_SMARTCARD, 0,
FALSE /* migration - TODO?*/,
FALSE /* handle_acks */,
smartcard_channel_handle_message,
&channel_cbs,

View File

@ -97,7 +97,6 @@ struct SndChannel {
int blocked;
uint32_t command;
int migrate;
uint32_t ack_generation;
uint32_t client_ack_generation;
uint32_t out_messages;
@ -923,7 +922,6 @@ static SndChannel *__new_channel(SndWorker *worker, int size, uint32_t channel_i
goto error2;
}
channel->migrate = migrate;
channel->send_messages = send_messages;
channel->handle_message = handle_message;
channel->on_message_done = on_message_done;
@ -1101,7 +1099,7 @@ static void on_new_playback_channel(SndWorker *worker)
spice_assert(playback_channel);
snd_set_command((SndChannel *)playback_channel, SND_PLAYBACK_MODE_MASK);
if (!playback_channel->base.migrate && playback_channel->base.active) {
if (playback_channel->base.active) {
snd_set_command((SndChannel *)playback_channel, SND_PLAYBACK_CTRL_MASK);
}
snd_set_command((SndChannel *)playback_channel, SND_PLAYBACK_VOLUME_MASK);
@ -1318,10 +1316,8 @@ static void on_new_record_channel(SndWorker *worker)
spice_assert(record_channel);
snd_set_command((SndChannel *)record_channel, SND_RECORD_VOLUME_MASK);
if (!record_channel->base.migrate) {
if (record_channel->base.active) {
snd_set_command((SndChannel *)record_channel, SND_RECORD_CTRL_MASK);
}
if (record_channel->base.active) {
snd_set_command((SndChannel *)record_channel, SND_RECORD_CTRL_MASK);
}
}

View File

@ -417,7 +417,6 @@ SpiceCharDeviceState *spicevmc_device_connect(SpiceCharDeviceInstance *sin,
state = (SpiceVmcState*)red_channel_create(sizeof(SpiceVmcState),
core, channel_type, id[channel_type]++,
FALSE /* migration - TODO? */,
FALSE /* handle_acks */,
spicevmc_red_channel_client_handle_message,
&channel_cbs,