mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 06:32:44 +00:00
red-channel-client: Move handle_migrate_flush_mark as a virtual function
Note that the return value was removed as not used. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
28a4fc5a10
commit
70367fd460
@ -51,6 +51,7 @@ protected:
|
||||
virtual void send_item(RedPipeItem *item) override;
|
||||
virtual bool handle_migrate_data(uint32_t size, void *message) override;
|
||||
virtual void migrate() override;
|
||||
virtual void handle_migrate_flush_mark() override;
|
||||
|
||||
public:
|
||||
red::unique_link<DisplayChannelClientPrivate> priv;
|
||||
|
||||
@ -2205,12 +2205,11 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
|
||||
send_create_surface(display, surface_id, data_is_valid);
|
||||
}
|
||||
|
||||
static bool handle_migrate_flush_mark(RedChannelClient *rcc)
|
||||
void DisplayChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
RedChannel *channel = rcc->get_channel();
|
||||
RedChannel *channel = get_channel();
|
||||
|
||||
channel->pipes_add_type(RED_PIPE_ITEM_TYPE_MIGRATE_DATA);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static uint64_t handle_migrate_data_get_serial(RedChannelClient *rcc, uint32_t size, void *message)
|
||||
@ -2501,7 +2500,6 @@ display_channel_class_init(DisplayChannelClass *klass)
|
||||
|
||||
channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_DISPLAY, NULL);
|
||||
|
||||
channel_class->handle_migrate_flush_mark = handle_migrate_flush_mark;
|
||||
channel_class->handle_migrate_data_get_serial = handle_migrate_data_get_serial;
|
||||
|
||||
// client callbacks
|
||||
|
||||
@ -57,6 +57,7 @@ protected:
|
||||
virtual void send_item(RedPipeItem *base) override;
|
||||
virtual bool handle_migrate_data(uint32_t size, void *message) override;
|
||||
virtual void migrate() override;
|
||||
virtual void handle_migrate_flush_mark() override;
|
||||
};
|
||||
|
||||
RedChannelClient* inputs_channel_client_create(RedChannel *channel,
|
||||
|
||||
@ -520,10 +520,9 @@ static void key_modifiers_sender(void *opaque)
|
||||
inputs_channel_push_keyboard_modifiers(inputs, inputs->modifiers);
|
||||
}
|
||||
|
||||
static bool inputs_channel_handle_migrate_flush_mark(RedChannelClient *rcc)
|
||||
void InputsChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
rcc->pipe_add_type(RED_PIPE_ITEM_MIGRATE_DATA);
|
||||
return TRUE;
|
||||
pipe_add_type(RED_PIPE_ITEM_MIGRATE_DATA);
|
||||
}
|
||||
|
||||
bool InputsChannelClient::handle_migrate_data(uint32_t size, void *message)
|
||||
@ -610,9 +609,6 @@ inputs_channel_class_init(InputsChannelClass *klass)
|
||||
|
||||
channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_INPUTS, NULL);
|
||||
|
||||
/* channel callbacks */
|
||||
channel_class->handle_migrate_flush_mark = inputs_channel_handle_migrate_flush_mark;
|
||||
|
||||
// client callbacks
|
||||
channel_class->connect = inputs_connect;
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ protected:
|
||||
virtual void send_item(RedPipeItem *item) override;
|
||||
virtual bool handle_migrate_data(uint32_t size, void *message) override;
|
||||
virtual void migrate() override;
|
||||
virtual void handle_migrate_flush_mark() override;
|
||||
|
||||
public:
|
||||
red::unique_link<MainChannelClientPrivate> priv;
|
||||
|
||||
@ -213,12 +213,11 @@ bool MainChannelClient::handle_message(uint16_t type, uint32_t size, void *messa
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool main_channel_handle_migrate_flush_mark(RedChannelClient *rcc)
|
||||
void MainChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
RedChannel *channel = rcc->get_channel();
|
||||
RedChannel *channel = get_channel();
|
||||
spice_debug("trace");
|
||||
main_channel_push_migrate_data_item(MAIN_CHANNEL(channel));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
MainChannelClient *main_channel_link(MainChannel *channel, RedClient *client,
|
||||
@ -274,9 +273,6 @@ main_channel_class_init(MainChannelClass *klass)
|
||||
object_class->constructed = main_channel_constructed;
|
||||
|
||||
channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_MAIN, NULL);
|
||||
|
||||
/* channel callbacks */
|
||||
channel_class->handle_migrate_flush_mark = main_channel_handle_migrate_flush_mark;
|
||||
}
|
||||
|
||||
static int main_channel_connect_semi_seamless(MainChannel *main_channel)
|
||||
|
||||
@ -1259,11 +1259,6 @@ void RedChannelClientPrivate::handle_pong(SpiceMsgPing *ping)
|
||||
|
||||
void RedChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
RedChannel *channel = get_channel();
|
||||
RedChannelClass *klass = RED_CHANNEL_GET_CLASS(channel);
|
||||
if (klass->handle_migrate_flush_mark) {
|
||||
klass->handle_migrate_flush_mark(this);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: the whole migration is broken with multiple clients. What do we want to do?
|
||||
|
||||
@ -175,7 +175,7 @@ private:
|
||||
void send_any_item(RedPipeItem *item);
|
||||
void handle_outgoing();
|
||||
void handle_incoming();
|
||||
void handle_migrate_flush_mark();
|
||||
virtual void handle_migrate_flush_mark();
|
||||
void handle_migrate_data_early(uint32_t size, void *message);
|
||||
inline bool prepare_pipe_add(RedPipeItem *item);
|
||||
void pipe_add_before_pos(RedPipeItem *item, GList *pipe_item_pos);
|
||||
|
||||
@ -44,7 +44,6 @@ struct RedChannelClient;
|
||||
struct RedClient;
|
||||
struct MainChannelClient;
|
||||
|
||||
typedef bool (*channel_handle_migrate_flush_mark_proc)(RedChannelClient *base);
|
||||
typedef uint64_t (*channel_handle_migrate_data_get_serial_proc)(RedChannelClient *base,
|
||||
uint32_t size, void *message);
|
||||
|
||||
@ -72,7 +71,6 @@ struct RedChannelClass
|
||||
*/
|
||||
spice_parse_channel_func_t parser;
|
||||
|
||||
channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark;
|
||||
channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial;
|
||||
|
||||
/*
|
||||
|
||||
@ -298,10 +298,9 @@ bool SmartCardChannelClient::handle_migrate_data(uint32_t size, void *message)
|
||||
mig_data);
|
||||
}
|
||||
|
||||
bool smartcard_channel_client_handle_migrate_flush_mark(RedChannelClient *rcc)
|
||||
void SmartCardChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
rcc->pipe_add_type(RED_PIPE_ITEM_TYPE_SMARTCARD_MIGRATE_DATA);
|
||||
return TRUE;
|
||||
pipe_add_type(RED_PIPE_ITEM_TYPE_SMARTCARD_MIGRATE_DATA);
|
||||
}
|
||||
|
||||
void smartcard_channel_client_set_char_device(SmartCardChannelClient *scc,
|
||||
|
||||
@ -43,14 +43,13 @@ private:
|
||||
virtual bool handle_message(uint16_t type, uint32_t size, void *message) override;
|
||||
virtual void send_item(RedPipeItem *item) override;
|
||||
virtual bool handle_migrate_data(uint32_t size, void *message) override;
|
||||
virtual void handle_migrate_flush_mark() override;
|
||||
};
|
||||
|
||||
SmartCardChannelClient* smartcard_channel_client_create(RedChannel *channel,
|
||||
RedClient *client, RedStream *stream,
|
||||
RedChannelCapabilities *caps);
|
||||
|
||||
bool smartcard_channel_client_handle_migrate_flush_mark(RedChannelClient *rcc);
|
||||
|
||||
void smartcard_channel_client_send_data(RedChannelClient *rcc,
|
||||
SpiceMarshaller *m,
|
||||
RedPipeItem *item,
|
||||
@ -60,10 +59,6 @@ void smartcard_channel_client_send_error(RedChannelClient *rcc,
|
||||
SpiceMarshaller *m,
|
||||
RedPipeItem *item);
|
||||
|
||||
bool smartcard_channel_client_handle_migrate_data(RedChannelClient *rcc,
|
||||
uint32_t size,
|
||||
void *message);
|
||||
|
||||
void smartcard_channel_client_set_char_device(SmartCardChannelClient *scc,
|
||||
RedCharDeviceSmartcard *device);
|
||||
|
||||
|
||||
@ -556,8 +556,6 @@ red_smartcard_channel_class_init(RedSmartcardChannelClass *klass)
|
||||
|
||||
channel_class->parser = spice_get_client_channel_parser(SPICE_CHANNEL_SMARTCARD, NULL);
|
||||
|
||||
channel_class->handle_migrate_flush_mark = smartcard_channel_client_handle_migrate_flush_mark;
|
||||
|
||||
// client callbacks
|
||||
channel_class->connect = smartcard_connect_client;
|
||||
}
|
||||
|
||||
@ -163,6 +163,7 @@ protected:
|
||||
virtual bool handle_message(uint16_t type, uint32_t size, void *msg) override;
|
||||
virtual void send_item(RedPipeItem *item) override;
|
||||
virtual bool handle_migrate_data(uint32_t size, void *message) override;
|
||||
virtual void handle_migrate_flush_mark() override;
|
||||
};
|
||||
|
||||
static RedChannelClient *
|
||||
@ -434,10 +435,9 @@ void VmcChannelClient::on_disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
static bool spicevmc_channel_client_handle_migrate_flush_mark(RedChannelClient *rcc)
|
||||
void VmcChannelClient::handle_migrate_flush_mark()
|
||||
{
|
||||
rcc->pipe_add_type(RED_PIPE_ITEM_TYPE_SPICEVMC_MIGRATE_DATA);
|
||||
return TRUE;
|
||||
pipe_add_type(RED_PIPE_ITEM_TYPE_SPICEVMC_MIGRATE_DATA);
|
||||
}
|
||||
|
||||
bool VmcChannelClient::handle_migrate_data(uint32_t size, void *message)
|
||||
@ -700,8 +700,6 @@ red_vmc_channel_class_init(RedVmcChannelClass *klass)
|
||||
object_class->constructed = red_vmc_channel_constructed;
|
||||
object_class->finalize = red_vmc_channel_finalize;
|
||||
|
||||
channel_class->handle_migrate_flush_mark = spicevmc_channel_client_handle_migrate_flush_mark;
|
||||
|
||||
// client callbacks
|
||||
channel_class->connect = spicevmc_connect;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user