[Spice-devel] [PATCH spice-server] display-channel: Limit number of surfaces to 1024

Frediano Ziglio fziglio at redhat.com
Fri Dec 15 13:43:37 UTC 2017


Qemu never used more than this number and today surfaces are not
much used so there's no reason to keep this limit so high.
This reduces quite a lot some internal structure
(DisplayChannelPrivate and DisplayChannelClientPrivate).

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/display-channel.c | 2 +-
 server/display-limits.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 38a8a0e70..77b69276f 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -68,7 +68,7 @@ display_channel_set_property(GObject *object,
     switch (property_id)
     {
         case PROP_N_SURFACES:
-            self->priv->n_surfaces = g_value_get_uint(value);
+            self->priv->n_surfaces = MIN(g_value_get_uint(value), NUM_SURFACES);
             break;
         case PROP_VIDEO_CODECS:
             display_channel_set_video_codecs(self, g_value_get_boxed(value));
diff --git a/server/display-limits.h b/server/display-limits.h
index 4cf911379..e875149bf 100644
--- a/server/display-limits.h
+++ b/server/display-limits.h
@@ -20,7 +20,7 @@
 #define DISPLAY_LIMITS_H_
 
 /** Maximum number of surfaces a guest can create */
-#define NUM_SURFACES 10000
+#define NUM_SURFACES 1024
 
 /** Maximum number of streams created by spice-server */
 #define NUM_STREAMS 50
-- 
2.14.3



More information about the Spice-devel mailing list