mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-12 17:15:21 +00:00
char-device: Allow send_msg_to_client callback to be NULL
Mostly of the callback dealing with sent messages and tokens can be NULL. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
8ec691f056
commit
5bcfc2b5d5
@ -114,9 +114,11 @@ red_char_device_send_msg_to_client(RedCharDevice *dev,
|
||||
RedPipeItem *msg,
|
||||
RedCharDeviceClientOpaque *client)
|
||||
{
|
||||
RedCharDeviceClass *klass = RED_CHAR_DEVICE_GET_CLASS(dev);
|
||||
RedCharDeviceClass *klass = RED_CHAR_DEVICE_GET_CLASS(dev);
|
||||
|
||||
klass->send_msg_to_client(dev, msg, client);
|
||||
if (klass->send_msg_to_client != NULL) {
|
||||
klass->send_msg_to_client(dev, msg, client);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@ -63,7 +63,8 @@ struct RedCharDeviceClass
|
||||
* or till the reading fails */
|
||||
RedPipeItem* (*read_one_msg_from_device)(RedCharDevice *self,
|
||||
SpiceCharDeviceInstance *sin);
|
||||
/* after this call, the message is unreferenced */
|
||||
/* After this call, the message is unreferenced.
|
||||
* Can be NULL. */
|
||||
void (*send_msg_to_client)(RedCharDevice *self,
|
||||
RedPipeItem *msg,
|
||||
RedCharDeviceClientOpaque *client);
|
||||
|
||||
@ -566,11 +566,6 @@ handle_msg_cursor_move(StreamDevice *dev, SpiceCharDeviceInstance *sin)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
stream_device_send_msg_to_client(RedCharDevice *self, RedPipeItem *msg, RedClient *client)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
stream_device_remove_client(RedCharDevice *self, RedClient *client)
|
||||
{
|
||||
@ -779,7 +774,6 @@ stream_device_class_init(StreamDeviceClass *klass)
|
||||
object_class->finalize = stream_device_finalize;
|
||||
|
||||
char_dev_class->read_one_msg_from_device = stream_device_read_msg_from_dev;
|
||||
char_dev_class->send_msg_to_client = stream_device_send_msg_to_client;
|
||||
char_dev_class->remove_client = stream_device_remove_client;
|
||||
char_dev_class->port_event = stream_device_port_event;
|
||||
}
|
||||
|
||||
@ -376,12 +376,6 @@ static RedPipeItem *spicevmc_chardev_read_msg_from_dev(RedCharDevice *self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void spicevmc_chardev_send_msg_to_client(RedCharDevice *self,
|
||||
RedPipeItem *msg,
|
||||
RedClient *client)
|
||||
{
|
||||
}
|
||||
|
||||
static void red_port_init_item_free(struct RedPipeItem *base)
|
||||
{
|
||||
RedPortInitPipeItem *item = SPICE_UPCAST(RedPortInitPipeItem, base);
|
||||
@ -912,7 +906,6 @@ red_char_device_spicevmc_class_init(RedCharDeviceSpiceVmcClass *klass)
|
||||
object_class->dispose = red_char_device_spicevmc_dispose;
|
||||
|
||||
char_dev_class->read_one_msg_from_device = spicevmc_chardev_read_msg_from_dev;
|
||||
char_dev_class->send_msg_to_client = spicevmc_chardev_send_msg_to_client;
|
||||
char_dev_class->remove_client = spicevmc_char_dev_remove_client;
|
||||
char_dev_class->port_event = spicevmc_port_event;
|
||||
char_dev_class->on_free_self_token = spicevmc_on_free_self_token;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user