[Spice-devel] [PATCH spice 2/3] server: Make copy paste support configurable
Hans de Goede
hdegoede at redhat.com
Thu Mar 24 09:39:47 PDT 2011
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.
---
server/reds.c | 14 ++++++++++++--
server/spice.h | 3 ++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/server/reds.c b/server/reds.c
index 4663a85..b4c4396 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 7e85ad7..d22425b 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);
--
1.7.3.2
More information about the Spice-devel
mailing list