summaryrefslogtreecommitdiffstats
path: root/server/red_channel.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-11-09 22:56:56 +0200
committerAlon Levy <alevy@redhat.com>2011-03-02 17:27:51 +0200
commitce03dcfbb55d38d06e3014a6c489ea82131472fc (patch)
tree332614693c3170276e042a8e061d4c79434f7253 /server/red_channel.h
parent8002a30f9ce4b8cbd00f5ff8ded6f72a297a2240 (diff)
downloadspice-ce03dcfbb55d38d06e3014a6c489ea82131472fc.tar.gz
spice-ce03dcfbb55d38d06e3014a6c489ea82131472fc.tar.xz
spice-ce03dcfbb55d38d06e3014a6c489ea82131472fc.zip
server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATA
Handling done in red_channel instead of per channel, using call backs for the channel specific part. Intended to reduce furthur reliance of channels on RedChannel struct. The commit makes the code harder to understand because of the artificial get_serial stuff, should later be fixed by having a joint migration header with the serial (since all channels pass it).
Diffstat (limited to 'server/red_channel.h')
-rw-r--r--server/red_channel.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/server/red_channel.h b/server/red_channel.h
index 50e67893..1841de47 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -123,6 +123,12 @@ typedef void (*channel_release_pipe_item_proc)(RedChannel *channel,
typedef void (*channel_on_incoming_error_proc)(RedChannel *channel);
typedef void (*channel_on_outgoing_error_proc)(RedChannel *channel);
+typedef int (*channel_handle_migrate_flush_mark)(RedChannel *channel);
+typedef uint64_t (*channel_handle_migrate_data)(RedChannel *channel,
+ uint32_t size, void *message);
+typedef uint64_t (*channel_handle_migrate_data_get_serial)(RedChannel *channel,
+ uint32_t size, void *message);
+
struct RedChannel {
RedsStream *stream;
SpiceCoreInterface *core;
@@ -166,6 +172,10 @@ struct RedChannel {
channel_on_incoming_error_proc on_incoming_error; /* alternative to disconnect */
channel_on_outgoing_error_proc on_outgoing_error;
int shut; /* signal channel is to be closed */
+
+ channel_handle_migrate_flush_mark handle_migrate_flush_mark;
+ channel_handle_migrate_data handle_migrate_data;
+ channel_handle_migrate_data_get_serial handle_migrate_data_get_serial;
};
/* if one of the callbacks should cause disconnect, use red_channel_shutdown and don't
@@ -180,7 +190,10 @@ RedChannel *red_channel_create(int size, RedsStream *stream,
channel_release_msg_recv_buf_proc release_recv_buf,
channel_hold_pipe_item_proc hold_item,
channel_send_pipe_item_proc send_item,
- channel_release_pipe_item_proc release_item);
+ channel_release_pipe_item_proc release_item,
+ channel_handle_migrate_flush_mark handle_migrate_flush_mark,
+ channel_handle_migrate_data handle_migrate_data,
+ channel_handle_migrate_data_get_serial handle_migrate_data_get_serial);
/* alternative constructor, meant for marshaller based (inputs,main) channels,
* will become default eventually */
@@ -196,7 +209,10 @@ RedChannel *red_channel_create_parser(int size, RedsStream *stream,
channel_send_pipe_item_proc send_item,
channel_release_pipe_item_proc release_item,
channel_on_incoming_error_proc incoming_error,
- channel_on_outgoing_error_proc outgoing_error);
+ channel_on_outgoing_error_proc outgoing_error,
+ channel_handle_migrate_flush_mark handle_migrate_flush_mark,
+ channel_handle_migrate_data handle_migrate_data,
+ channel_handle_migrate_data_get_serial handle_migrate_data_get_serial);
int red_channel_is_connected(RedChannel *channel);