spice/server/spice-experimental.h
Yonit Halperin cd402151de server/spice.h: semi-seamless migration interface, RHBZ #738266
semi-seamless migration details:

migration source side
---------------------
(1) spice_server_migrate_connect (*): tell client to link
    to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN.
    This should be called upon client_migrate_info cmd.
    client_migrate_info is asynchronous.
(2) Complete spice_server_migrate_connect 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.
(cherry picked from commit 6e56bea67c branch 0.8)

Conflicts:

	server/spice.h
2011-11-02 11:20:08 +02:00

42 lines
1.1 KiB
C

#ifndef __SPICE_EXPERIMENTAL_H__
#define __SPICE_EXPERIMENTAL_H__
#include "spice.h"
/* tunnel interface */
#define SPICE_INTERFACE_NET_WIRE "net_wire"
#define SPICE_INTERFACE_NET_WIRE_MAJOR 1
#define SPICE_INTERFACE_NET_WIRE_MINOR 1
typedef struct SpiceNetWireInterface SpiceNetWireInterface;
typedef struct SpiceNetWireInstance SpiceNetWireInstance;
typedef struct SpiceNetWireState SpiceNetWireState;
struct SpiceNetWireInterface {
SpiceBaseInterface base;
struct in_addr (*get_ip)(SpiceNetWireInstance *sin);
int (*can_send_packet)(SpiceNetWireInstance *sin);
void (*send_packet)(SpiceNetWireInstance *sin, const uint8_t *pkt, int len);
};
struct SpiceNetWireInstance {
SpiceBaseInstance base;
SpiceNetWireState *st;
};
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_client_state(SpiceServer *s);
#endif // __SPICE_EXPERIMENTAL_H__