[Spice-devel] [PATCH spice-gtk v2 2/2] Add command line options for setting the cache size and the glz window size

Yonit Halperin yhalperi at redhat.com
Sun Jan 22 00:12:37 PST 2012


This options will help us tune and find the optimal values.
---
 gtk/spice-option.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gtk/spice-option.c b/gtk/spice-option.c
index 394a07d..d466f94 100644
--- a/gtk/spice-option.c
+++ b/gtk/spice-option.c
@@ -36,6 +36,8 @@ static char *usbredir_filter = NULL;
 static gboolean smartcard = FALSE;
 static gboolean disable_audio = FALSE;
 static gboolean disable_usbredir = FALSE;
+static gint cache_size = 0;
+static gint glz_window_size = 0;
 
 static void option_version(void)
 {
@@ -84,6 +86,10 @@ GOptionGroup* spice_get_option_group(void)
           N_("Enable Spice-GTK debugging"), NULL },
         { "spice-gtk-version", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_version,
           N_("Display Spice-GTK version information"), NULL },
+        { "spice-cache-size", '\0', 0, G_OPTION_ARG_INT, &cache_size,
+          N_("Image cache size"), N_("<bytes>") },
+        { "spice-glz-window-size", '\0', 0, G_OPTION_ARG_INT, &glz_window_size,
+          N_("Glz compression history size"), N_("<bytes>") },
         { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
     };
     GOptionGroup *grp;
@@ -146,4 +152,8 @@ void spice_set_session_option(SpiceSession *session)
         g_object_set(session, "enable-usbredir", FALSE, NULL);
     if (disable_audio)
         g_object_set(session, "enable-audio", FALSE, NULL);
+    if (cache_size)
+        g_object_set(session, "cache-size", cache_size, NULL);
+    if (glz_window_size)
+        g_object_set(session, "glz_window_size", glz_window_size, NULL);
 }
-- 
1.7.6.4



More information about the Spice-devel mailing list