[Spice-devel] [PATCH] Add config functions.

Gerd Hoffmann kraxel at redhat.com
Fri Aug 27 06:37:20 PDT 2010


A bunch of configuration functions where never ported forward from
rhel-6 to upstream.  Add them so we can add qemu config options for
these settings.
---
 server/reds.c  |   27 +++++++++++++++++++++++++++
 server/spice.h |   11 +++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index b7c6ce7..54c6d4f 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3943,6 +3943,33 @@ __visible__ int spice_server_kbd_leds(SpiceKbdInstance *sin, int leds)
     return 0;
 }
 
+__visible__ int spice_server_set_streaming_video(SpiceServer *s, int value)
+{
+    ASSERT(reds == s);
+    if (value != SPICE_STREAM_VIDEO_OFF &&
+        value != SPICE_STREAM_VIDEO_ALL &&
+        value != SPICE_STREAM_VIDEO_FILTER)
+        return -1;
+    streaming_video = value;
+    red_dispatcher_on_sv_change();
+    return 0;
+}
+
+__visible__ int spice_server_set_playback_compression(SpiceServer *s, int enable)
+{
+    ASSERT(reds == s);
+    snd_set_playback_compression(enable);
+    return 0;
+}
+
+__visible__ int spice_server_set_agent_mouse(SpiceServer *s, int enable)
+{
+    ASSERT(reds == s);
+    agent_mouse = enable;
+    reds_update_mouse_mode();
+    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 fc7d5b5..ef16a6a 100644
--- a/server/spice.h
+++ b/server/spice.h
@@ -360,6 +360,17 @@ int spice_server_set_channel_security(SpiceServer *s, const char *channel, int s
 
 int spice_server_add_renderer(SpiceServer *s, const char *name);
 
+enum {
+    SPICE_STREAM_VIDEO_INVALID,
+    SPICE_STREAM_VIDEO_OFF,
+    SPICE_STREAM_VIDEO_ALL,
+    SPICE_STREAM_VIDEO_FILTER
+};
+
+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_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.1



More information about the Spice-devel mailing list