[Spice-devel] [RFC PATCH spice 0.8 01/19] server/spice.h: semi-seamless migration interface, RHBZ #738266

Alon Levy alevy at redhat.com
Mon Sep 19 05:00:27 PDT 2011


On Mon, Sep 19, 2011 at 12:46:54PM +0300, Yonit Halperin wrote:
> semi-seamless migration details:
> 
> migration source side
> ---------------------
> (1) spice_server_migrate_info (*): tell client to link
>     to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN.
>     client_migrate_info cmd is asynchronous.
> (2) Complete client_migrate_info only when the client has been connected
>     to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout.
> (3) spice_server_migrate_end: tell client migration it can switch to the target - send
>     SPICE_MSG_MAIN_MIGRATE_END.
> (4) client cleans up all data related to the connection to the source and switches to the target.
>     It sends SPICE_MSGC_MAIN_MIGRATE_END.
> 
> migration target side
> ---------------------
> (1) the server identifies itself as a migraiton target since the client is linked with (connection_id != 0)
> (2) server doesn't start the channels' logic (channel->link) till it receives SPICE_MSGC_MAIN_MIGRATE_END
>     from the client.
> 
> *   After migration starts, the target qemu is blocked and cannot accept new spice client
>     connections. Thus, we trigger the connection to the target upon client_migrate_info
>     command.
> 
> Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
> ---
>  server/spice-experimental.h |    3 ---
>  server/spice.h              |   21 ++++++++++++++++++++-
>  2 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/server/spice-experimental.h b/server/spice-experimental.h
> index 482ac44..6997aa0 100644
> --- a/server/spice-experimental.h
> +++ b/server/spice-experimental.h
> @@ -29,16 +29,13 @@ void spice_server_net_wire_recv_packet(SpiceNetWireInstance *sin,
>                                         const uint8_t *pkt, int len);
>  
>  /* spice seamless client migration (broken) */
> -
>  enum {
>      SPICE_MIGRATE_CLIENT_NONE = 1,
>      SPICE_MIGRATE_CLIENT_WAITING,
>      SPICE_MIGRATE_CLIENT_READY,
>  };
>  
> -int spice_server_migrate_start(SpiceServer *s);
>  int spice_server_migrate_client_state(SpiceServer *s);
> -int spice_server_migrate_end(SpiceServer *s, int completed);
>  
>  #endif // __SPICE_EXPERIMENTAL_H__
>  
> diff --git a/server/spice.h b/server/spice.h
> index ac5a41e..8f7bcac 100644
> --- a/server/spice.h
> +++ b/server/spice.h
> @@ -469,11 +469,30 @@ int spice_server_set_agent_copypaste(SpiceServer *s, int enable);
>  int spice_server_get_sock_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);
>  int spice_server_get_peer_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);
>  
> -/* spice switch-host client migration */
> +/* migration interface */
> +#define SPICE_INTERFACE_MIGRATION "migration"
> +#define SPICE_INTERFACE_MIGRATION_MAJOR 1
> +#define SPICE_INTERFACE_MIGRATION_MINOR 1
> +typedef struct SpiceMigrateInterface SpiceMigrateInterface;
> +typedef struct SpiceMigrateInstance SpiceMigrateInstance;
> +typedef struct SpiceMigrateState SpiceMigrateState;
> +
> +struct SpiceMigrateInterface {
> +    SpiceBaseInterface base;
> +    void (*migrate_info_complete)(SpiceMigrateInstance *sin);

client_migrate_info_complete? like the monitor command it indicates the completion of.

> +};
>  
> +struct SpiceMigrateInstance {
> +    SpiceBaseInstance base;
> +    SpiceMigrateState *st;
> +};
> +
> +/* spice switch-host client migration */
>  int spice_server_migrate_info(SpiceServer *s, const char* dest,
>                                int port, int secure_port,
>                                const char* cert_subject);
>  int spice_server_migrate_switch(SpiceServer *s);
>  

+/* spice semi seamless client migration */ ?

> +int spice_server_migrate_start(SpiceServer *s);
> +int spice_server_migrate_end(SpiceServer *s, int completed);
>  #endif
> -- 
> 1.7.4.4
> 


More information about the Spice-devel mailing list