summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-03-24 16:50:45 +0100
committerHans de Goede <hdegoede@redhat.com>2011-03-24 17:30:03 +0100
commitbcf9a60aa97419e12dc83916719e3633bfbb872f (patch)
treeca4a885133212d9643c6b0d0cc044fa494814c6e
parentc2db6d1066bcb73c5ddf9e38c4ef30545706eae9 (diff)
server: Make copy paste support configurable
Also bump SPICE_SERVER_VERSION to 0x000801 as 0.8.1 will be the first version with the new API for this, and we need to be able to detect the presence of this API in qemu.
-rw-r--r--server/reds.c14
-rw-r--r--server/spice.h3
2 files changed, 14 insertions, 3 deletions
diff --git a/server/reds.c b/server/reds.c
index 4663a852..b4c43963 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -104,6 +104,7 @@ spice_wan_compression_t zlib_glz_state = SPICE_WAN_COMPRESSION_AUTO;
void *red_tunnel = NULL;
#endif
int agent_mouse = TRUE;
+int agent_copypaste = TRUE;
static void openssl_init();
@@ -3410,8 +3411,8 @@ static void init_vd_agent_resources()
ring_init(&state->internal_bufs);
ring_init(&state->write_queue);
ring_init(&state->read_bufs);
- agent_msg_filter_init(&state->write_filter, TRUE);
- agent_msg_filter_init(&state->read_filter, TRUE);
+ agent_msg_filter_init(&state->write_filter, agent_copypaste);
+ agent_msg_filter_init(&state->read_filter, agent_copypaste);
state->read_state = VDI_PORT_READ_STATE_READ_HADER;
state->recive_pos = (uint8_t *)&state->vdi_chunk_header;
@@ -3838,6 +3839,15 @@ __visible__ int spice_server_set_agent_mouse(SpiceServer *s, int enable)
return 0;
}
+__visible__ int spice_server_set_agent_copypaste(SpiceServer *s, int enable)
+{
+ ASSERT(reds == s);
+ agent_copypaste = enable;
+ reds->agent_state.write_filter.copy_paste_enabled = agent_copypaste;
+ reds->agent_state.read_filter.copy_paste_enabled = agent_copypaste;
+ return 0;
+}
+
__visible__ int spice_server_migrate_info(SpiceServer *s, const char* dest,
int port, int secure_port,
const char* cert_subject)
diff --git a/server/spice.h b/server/spice.h
index 7e85ad7e..d22425bb 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -21,7 +21,7 @@
#include <stdint.h>
#include <sys/socket.h>
-#define SPICE_SERVER_VERSION 0x000701 /* release 0.7.1 */
+#define SPICE_SERVER_VERSION 0x000801 /* release 0.8.1 */
/* interface base type */
@@ -428,6 +428,7 @@ enum {
int spice_server_set_streaming_video(SpiceServer *s, int value);
int spice_server_set_playback_compression(SpiceServer *s, int enable);
int spice_server_set_agent_mouse(SpiceServer *s, int enable);
+int spice_server_set_agent_copypaste(SpiceServer *s, int enable);
int spice_server_get_sock_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);
int spice_server_get_peer_info(SpiceServer *s, struct sockaddr *sa, socklen_t *salen);