[Spice-devel,spice-gtk,5/7] seamless migration: transfer pending msgs to the destination, instead of sending them to the src before FLUSH_MARK

Submitted by Yonit Halperin on Aug. 15, 2012, 7:56 a.m.

Details

Message ID 1345017402-872-65-git-send-email-yhalperi@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Yonit Halperin Aug. 15, 2012, 7:56 a.m.
In order to save migration time, and probably also decrease migration
data size, we push the flush mark to the src server before any other
message. All the other pending msgs will be sent later to the
destination server (see next patch).
---
 gtk/channel-base.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/channel-base.c b/gtk/channel-base.c
index 2968f42..d7a5461 100644
--- a/gtk/channel-base.c
+++ b/gtk/channel-base.c
@@ -157,12 +157,9 @@  void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
 
     SPICE_DEBUG("%s: channel %s flags %u", __FUNCTION__, c->name, mig->flags);
     if (mig->flags & SPICE_MIGRATE_NEED_FLUSH) {
-        /* iterate_write is blocking and flushing all pending write */
-        SPICE_CHANNEL_GET_CLASS(channel)->iterate_write(channel);
-
+        /* pushing the mark msg before all other messgages and sending it, and only it */
         out = spice_msg_out_new(SPICE_CHANNEL(channel), SPICE_MSGC_MIGRATE_FLUSH_MARK);
         spice_msg_out_send_internal(out);
-        SPICE_CHANNEL_GET_CLASS(channel)->iterate_write(channel);
     }
     if (mig->flags & SPICE_MIGRATE_NEED_DATA_TRANSFER) {
         spice_channel_recv_msg(channel, get_msg_handler, &data);
@@ -175,8 +172,10 @@  void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
         }
     }
 
+    /* swapping channels sockets */
     spice_session_channel_migrate(c->session, channel);
 
+    /* pushing the MIGRATE_DATA before all other pending messages */
     if ((mig->flags & SPICE_MIGRATE_NEED_DATA_TRANSFER) && (data != NULL)) {
         out = spice_msg_out_new(SPICE_CHANNEL(channel), SPICE_MSGC_MIGRATE_DATA);
         spice_marshaller_add(out->marshaller, data->data,

Comments

On Wed, Aug 15, 2012 at 9:56 AM, Yonit Halperin <yhalperi@redhat.com> wrote:
> message. All the other pending msgs will be sent later to the
> destination server (see next patch).

If it breaks current semi-seamless or older migration methods, it
would be better to squash with the next patch then.
On 08/21/2012 02:24 PM, Marc-André Lureau wrote:
> On Wed, Aug 15, 2012 at 9:56 AM, Yonit Halperin<yhalperi@redhat.com>  wrote:
>> message. All the other pending msgs will be sent later to the
>> destination server (see next patch).
>
> If it breaks current semi-seamless or older migration methods, it
> would be better to squash with the next patch then.
>

hmmm...didn't thought about protcol=1. I need to not call iterate_write 
before the mark only for protocol 2.
The next patch is also valid for protocol 1.
semi-seamless is not affected by the patch.

Thanks,
Yonit.