[Spice-commits] 2 commits - spice/enums.h spice/protocol.h

Yonit Halperin yhalperi at kemper.freedesktop.org
Sun Aug 26 23:14:54 PDT 2012


 spice/enums.h    |    6 ++++++
 spice/protocol.h |    2 ++
 2 files changed, 8 insertions(+)

New commits:
commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Mon Jul 2 11:56:27 2012 +0300

    seamless migration support
    
    The main difference between semi-seamless and seamless migration is that
    while in semi-seamless migration the state of all the channels is
    being completely reset after migration is complete, in seamless migration
    the essential parts of the state are restored on the server side, and
    are left the same on the client side. semi-seamless migration is
    equivalent to having the client disconnect from the src and connected
    from scratch to the dest, with the exception, that the handshake with
    the dest server occurs before the client has disconnected from the src.
    In semi-seamless migration in-flight data gets lost, e.g., a file
    transfer to a usb device might be disrupted.
    
    =======================
    ===protocol details====
    =======================
    
    Let s1, s2, and c be the src server, dest server and client, respectively.
    
    Semi-Seamless migration protocol
    ================================
    
    pre-migration phase:
    --------------------
    (1) s1->c: SPICE_MSG_MAIN_MIGRATE_BEGIN
        In response, c tries to establish a connection to s2. After the connection is
        established, it is inactive (the client doesn't attempt to read or
        write messages from/to it)
    (2) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED or
               SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR
    
    post migration phase:
    ---------------------
    (1) s1->c: SPICE_MSG_MAIN_MIGRATE_END or
               SPICE_MSG_MAIN_MIGRATE_CANCEL
        In case of the former, c disconnects from s1, resets all its
        channels states and switches to an active connection with s2.
    (2) c->s2: SPICE_MSGC_MAIN_MIGRATE_END
        The msg signals that all the channels have been migrated successfully to s2.
    
    Seamless migration protocol
    ===========================
    
    pre-migration phase:
    --------------------
    In case qemu/libvirt/client do not support seamless migration,
    s1 takes the semi-seamless pathway for migration. Otherwise:
    
    (1) s1->c: SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS (*New*)
        The msg includes the version of the migration protocol
        of s1.
        In response c tries to establish a connection to s2.
    (2)
        If the connection fails:
        (2.1) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR
    
        If s2 supports SPICE_MAIN_CAP_SEAMLESS_MIGRATE:
        (2.2) c->s2: SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS (*New*)
              The msg includes the version of the migration protocol
              of s1. The msg is used for querying s2 if seamless migration
              is possible, given the migration protocol version of s1.
    
          (2.2.1) s2->c: SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK (*New*)
          (2.2.2) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS (*New*) or
                         SPICE_MSGC_MAIN_MIGRATE_CONNECTED
                  The latter is sent when c receives SEAMLESS_NACK, and
                  indicates s1 to apply semi-seamless protocol on post
                  migraion phase.
    
        If s2 does not support SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE:
        (2.3) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED
              (see 2.2.2)
    
    post migration phase:
    ---------------------
    While the pre migration phase was conducted by the main channel, this
    phase's protocol occurs in all the migrated channels.
    
    (1) s1->c: SPICE_MSG_MIGRATE
        The msg marks the client that the connection is paused from s1 side, and
        next to this msg, the only possible msg s1 can send is
        SPICE_MSG_MIGRATE_DATA
    
        msg optional flags:
        (a) MIGRATE_FLUSH_MARK
            This flag is required for finalizing the channel connection
            without losing any in-flight data.
            This flag indicates that s1 expects SPICE_MSGC_MIGRATE_FLUSH_MARK,
            for signaling that c will pause the connection and not send any more messages
            to s1.
        (b) MIGRATE_DATA
            The flag indicates that c should receive from s1
            SPICE_MSG_MIGRATE_DATA
    (2) c->s1: SPICE_MSGC_MIGRATE_FLUSH_MARK (if required)
        c pushes the msg to the head of its output msg queue,
        and sends it before all its other pending msgs - they will be sent to s2
        later.
    (3) s1->c: SPICE_MSG_MIGRATE_DATA (if required)
        The msg contains all the data that the server requires for restoring
        the channel's state on s2 side correctly.
    (4) c disconnects the channel from s1 and switches to an active connection
        with s2.
    (4) c->s2: SPICE_MSGC_MIGRATE_DATA

diff --git a/spice/enums.h b/spice/enums.h
index 57d8f3b..1936bdf 100644
--- a/spice/enums.h
+++ b/spice/enums.h
@@ -415,6 +415,9 @@ enum {
     SPICE_MSG_MAIN_NAME,
     SPICE_MSG_MAIN_UUID,
     SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS,
+    SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS,
+    SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK,
+    SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_NACK,
 
     SPICE_MSG_END_MAIN
 };
@@ -429,6 +432,8 @@ enum {
     SPICE_MSGC_MAIN_AGENT_DATA,
     SPICE_MSGC_MAIN_AGENT_TOKEN,
     SPICE_MSGC_MAIN_MIGRATE_END,
+    SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS,
+    SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS,
 
     SPICE_MSGC_END_MAIN
 };
diff --git a/spice/protocol.h b/spice/protocol.h
index 108f044..b46861a 100644
--- a/spice/protocol.h
+++ b/spice/protocol.h
@@ -121,6 +121,7 @@ enum {
     SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE,
     SPICE_MAIN_CAP_NAME_AND_UUID,
     SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS,
+    SPICE_MAIN_CAP_SEAMLESS_MIGRATE,
 };
 
 enum {
commit c20bc58c4e44b6403b7e7a9efc4f12dee0fc100e
Author: Yonit Halperin <yhalperi at redhat.com>
Date:   Wed Aug 8 10:44:27 2012 +0300

    add SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
    
    Similarly to SPICE_MSG_AGENT_CONNECTED, the msg notifies the main
    channel about attaching an agent. In addition the msg also contains the
    number of tokens allocated to the client.

diff --git a/spice/enums.h b/spice/enums.h
index 7691dd3..57d8f3b 100644
--- a/spice/enums.h
+++ b/spice/enums.h
@@ -414,6 +414,7 @@ enum {
     SPICE_MSG_MAIN_MIGRATE_END,
     SPICE_MSG_MAIN_NAME,
     SPICE_MSG_MAIN_UUID,
+    SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS,
 
     SPICE_MSG_END_MAIN
 };
diff --git a/spice/protocol.h b/spice/protocol.h
index a0b3004..108f044 100644
--- a/spice/protocol.h
+++ b/spice/protocol.h
@@ -120,6 +120,7 @@ enum {
 enum {
     SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE,
     SPICE_MAIN_CAP_NAME_AND_UUID,
+    SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS,
 };
 
 enum {


More information about the Spice-commits mailing list