[Spice-devel] [spice PATCH 49/55] red_channel: remove unused migrate flag from RedChannel
Yonit Halperin
yhalperi at redhat.com
Wed Aug 15 00:56:29 PDT 2012
The relevant flags reside in RedChannelClient and RedClient
---
server/inputs_channel.c | 1 -
server/main_channel.c | 2 +-
server/red_channel.c | 7 +++----
server/red_channel.h | 5 ++---
server/red_worker.c | 7 +++----
server/smartcard.c | 1 -
server/snd_worker.c | 10 +++-------
server/spicevmc.c | 1 -
8 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index d753bac..684dec6 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -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,
diff --git a/server/main_channel.c b/server/main_channel.c
index 1df19df..7094181 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -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,
diff --git a/server/red_channel.c b/server/red_channel.c
index 18b69d3..97a26d1 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -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);
diff --git a/server/red_channel.h b/server/red_channel.h
index aab7d2d..0bd4cb1 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -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,
diff --git a/server/red_worker.c b/server/red_worker.c
index 82d47d2..c18c981 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9966,7 +9966,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,
@@ -9994,7 +9994,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,
@@ -10155,7 +10154,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,
@@ -10360,7 +10359,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,
diff --git a/server/smartcard.c b/server/smartcard.c
index 7c3a070..a7e81d5 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -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,
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 7c47242..995823c 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -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);
}
}
diff --git a/server/spicevmc.c b/server/spicevmc.c
index b6eaa08..058a182 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -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,
--
1.7.7.6
More information about the Spice-devel
mailing list