summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-08-06 22:25:57 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-08-27 09:13:12 +0300
commit115d095d469cd6e9697c4947e985379ec86fc768 (patch)
treead07d27b706294677804c533211a815f603c7afa
parente142bd9a611ce5980b29e8084b7d154013a16686 (diff)
downloadspice-115d095d469cd6e9697c4947e985379ec86fc768.tar.gz
spice-115d095d469cd6e9697c4947e985379ec86fc768.tar.xz
spice-115d095d469cd6e9697c4947e985379ec86fc768.zip
main_channel: don't expect init msg in a seamless migration destination
If the server is a destination of seamless migration, send msgs to the client, even though an init msg has not been sent to the client.
-rw-r--r--server/main_channel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/main_channel.c b/server/main_channel.c
index 70941817..22660f53 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -157,6 +157,7 @@ struct MainChannelClient {
int mig_wait_prev_complete;
int mig_wait_prev_try_seamless;
int init_sent;
+ int seamless_mig_dst;
};
enum NetTestStage {
@@ -726,14 +727,17 @@ static void main_channel_send_item(RedChannelClient *rcc, PipeItem *base)
MainChannelClient *mcc = SPICE_CONTAINEROF(rcc, MainChannelClient, base);
SpiceMarshaller *m = red_channel_client_get_marshaller(rcc);
- if (!mcc->init_sent && base->type != SPICE_MSG_MAIN_INIT) {
+ /* In semi-seamless migration (dest side), the connection is started from scratch, and
+ * we ignore any pipe item that arrives before the INIT msg is sent.
+ * For seamless we don't send INIT, and the connection continues from the same place
+ * it stopped on the src side. */
+ if (!mcc->init_sent && !mcc->seamless_mig_dst && base->type != PIPE_ITEM_TYPE_MAIN_INIT) {
spice_printerr("Init msg for client %p was not sent yet "
- "(client is probably during migration). Ignoring msg type %d",
+ "(client is probably during semi-seamless migration). Ignoring msg type %d",
rcc->client, base->type);
main_channel_release_pipe_item(rcc, base, FALSE);
return;
}
-
switch (base->type) {
case PIPE_ITEM_TYPE_MAIN_CHANNELS_LIST:
main_channel_marshall_channels(rcc, m, base);
@@ -845,6 +849,7 @@ void main_channel_client_handle_migrate_dst_do_seamless(MainChannelClient *mcc,
uint32_t src_version)
{
if (reds_on_migrate_dst_set_seamless(mcc, src_version)) {
+ mcc->seamless_mig_dst = TRUE;
red_channel_client_pipe_add_empty_msg(&mcc->base,
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK);
} else {