[Spice-devel] [PATCH migration 00/19] semi-seamless migration for master

Yonit Halperin yhalperi at redhat.com
Wed Oct 12 03:38:50 PDT 2011


Hi,
in the following patch series the same logic of semi-seamless for the 0.8 branch was
adjusted to multiple clients (and to the refactoring of red_channel/reds/main_channel).
The code differs from the 0.8 branch only for the server side. The client patches are the same,
except for small conflicts solving.

Migration scheme:
    migration source side
    ---------------------
    (1) spice_server_migrate_connect: tell all clients (the ones that are capable) to link
        to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN.
        It will be called on client_migrate_info cmd. client_migrate_info is asynchronous.
    (2) Complete client_migrate_info only when all the above clients have been connected
        to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout.
    (3) spice_server_migrate_end: tell the clients they can switch to the target - 
        (a) send SPICE_MSG_MAIN_MIGRATE_END to clients that are already connected to the target.
            These clients clean up all data related to the connection to the source and switches to the target.
            They send SPICE_MSGC_MAIN_MIGRATE_END.
        (b) send SPICE_MSG_MAIN_SWITCH_HOST to clients that are not connected to the target
                                                                    
    migration target side
    ---------------------
    (1) a main_channel_client identifies itself as a migraiton target since the corresponding client is linked with (connection_id != 0)
    (2) server doesn't start this channel client logic till it receives SPICE_MSGC_MAIN_MIGRATE_END from this client.

 Differences from 0.8 branch
 ---------------------------
 - Since we currently support sound/smartcard channels only for the first connected client, if a client A is connected to the target
   before migration started, and another client B is migrated to this target, client A will be disconnected if they both have
   sound/smartcard channel.
 - The agent is broken for multiclient. I removed several conditions that linked between migration to the agent code.
   They seemed to be unnecessary since I prevented msg sending at the target side to clients that their migraiton have
   not yet been completed.
 - I decided not to stop listening to new spice connection after spice_server_migrate_connect is called.
   Instead, new connections that arrive after spice_server_migrate_connect and before spice_server_migrate_end,
   will receive SWITCH_HOST when migration completes.
   If it will be necessary, I will change the 0.8 branch as well.

Yonit

Yonit Halperin (19):
  server: set & test channel capabilities in red_channel
  server/spice.h: semi-seamless migration interface, RHBZ #738266
  server: handle migration interface addition     (cherry picked from
    commit 3ac0075cdac8fa42de47a7882022795e96cb1fee branch 0.8)
  configure: spice-protocol >= 0.9.1 (semi-seamless migration protocol)
        (cherry picked from commit
    55ccc022ec9829523ebe36fdf0ec7c593ce76c22 branch 0.8)
  server,proto: tell the clients to connect to the migration target
    before migraton starts
  spice.proto: add SPICE_MSG_MAIN_MIGRATE_END &
    SPICE_MSGC_MAIN_MIGRATE_END     (cherry picked from commit
    cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)
  server: handle spice_server_migrate_end
  server: move the linking of channels to a separate routine
  server: handling semi-seamless migration in the target side
  server: turn spice_server_migrate_start into a valid call
  client: rewrite surfaces cache
  client: handle SpiceMsgMainMigrationBegin (semi-seamless migration)
  client: handle SPICE_MSG_MAIN_MIGRATE_END
  client: main channel migration: do partial cleanup when switching
    hosts
  client: playback/record channels: implement on_disconnect     (cherry
    picked from commit d3ed9d5e9d52ddcadcb3c8c77dd827b50071d813 branch
    0.8)
  client: display channel migration     (cherry picked from commit
    cad3c585444f940f60c12789f4174f2d32bec70f branch 0.8)
  client: display channel - destroy all surfaces on disconnect
  client: support semi-seamless migration between spice servers with
    different protocols.
  Release 0.9.2

 NEWS                        |    8 +
 client/audio_channels.h     |   12 +-
 client/canvas.cpp           |   25 ++-
 client/canvas.h             |  152 +----------
 client/display_channel.cpp  |  316 ++++++++++++++--------
 client/display_channel.h    |   29 +--
 client/playback_channel.cpp |   22 ++-
 client/record_channel.cpp   |   39 ++-
 client/red_channel.cpp      |   80 ++++++
 client/red_channel.h        |   21 ++
 client/red_client.cpp       |  156 ++++++++++--
 client/red_client.h         |   17 +-
 client/red_gdi_canvas.cpp   |    4 +-
 client/red_gdi_canvas.h     |    2 +-
 client/red_gl_canvas.cpp    |    4 +-
 client/red_gl_canvas.h      |    2 +-
 client/red_sw_canvas.cpp    |    6 +-
 client/red_sw_canvas.h      |    2 +-
 common/messages.h           |    2 +
 configure.ac                |    4 +-
 server/inputs_channel.c     |    4 +-
 server/main_channel.c       |  331 +++++++++++++++--------
 server/main_channel.h       |   38 ++-
 server/red_channel.c        |  109 +++++++-
 server/red_channel.h        |   39 ++-
 server/red_tunnel_worker.c  |    3 +-
 server/red_worker.c         |    3 +-
 server/reds.c               |  636 +++++++++++++++++++++++++------------------
 server/reds.h               |   22 +-
 server/smartcard.c          |    4 +-
 server/snd_worker.c         |   66 ++---
 server/spice-experimental.h |    3 -
 server/spice-server.syms    |    1 +
 server/spice.h              |   27 ++-
 server/spicevmc.c           |    4 +-
 spice.proto                 |    9 +-
 36 files changed, 1410 insertions(+), 792 deletions(-)

-- 
1.7.6.4



More information about the Spice-devel mailing list