diff options
Diffstat (limited to 'src/vdagentd.c')
-rw-r--r-- | src/vdagentd.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vdagentd.c b/src/vdagentd.c index a699681..7e820b6 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -102,6 +102,7 @@ static void send_capabilities(struct vdagent_virtio_port *vport, VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_GUEST_LINEEND_LF); VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_MAX_CLIPBOARD); VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_AUDIO_VOLUME_SYNC); + VD_AGENT_SET_CAPABILITY(caps->caps, VD_AGENT_CAP_SEAMLESS_MODE); vdagent_virtio_port_write(vport, VDP_CLIENT_PORT, VD_AGENT_ANNOUNCE_CAPABILITIES, 0, @@ -316,6 +317,20 @@ static void do_client_file_xfer(struct vdagent_virtio_port *vport, udscs_write(conn, msg_type, 0, 0, data, message_header->size); } +static void do_seamless_mode(struct vdagent_virtio_port *vport, + VDAgentMessage *message_header, + uint8_t *data) +{ + if (active_session_conn == NULL) { + syslog(LOG_DEBUG, "Could not find an agent connection belonging to the " + "active session, ignoring seamless mode request"); + return; + } + + udscs_write(active_session_conn, VDAGENTD_SEAMLESS_MODE, 0, 0, + data, message_header->size); +} + static int virtio_port_read_complete( struct vdagent_virtio_port *vport, int port_nr, @@ -409,6 +424,12 @@ static int virtio_port_read_complete( do_client_volume_sync(vport, port_nr, message_header, (VDAgentAudioVolumeSync *)data); break; + case VD_AGENT_SEAMLESS_MODE: + if (message_header->size < sizeof(VDAgentSeamlessMode)) + goto size_error; + + do_seamless_mode(vport, message_header, data); + break; default: syslog(LOG_WARNING, "unknown message type %d, ignoring", message_header->type); @@ -778,6 +799,11 @@ static void agent_read_complete(struct udscs_connection **connp, g_hash_table_remove(active_xfers, GUINT_TO_POINTER(status.id)); break; } + case VDAGENTD_SEAMLESS_MODE_LIST: + vdagent_virtio_port_write(virtio_port, VDP_CLIENT_PORT, + VD_AGENT_SEAMLESS_MODE_LIST, 0, + data, header->size); + break; default: syslog(LOG_ERR, "unknown message from vdagent: %u, ignoring", |