[Spice-commits] 6 commits - server/cursor-channel-client.c server/cursor-channel-client.h server/cursor-channel.c server/dcc.c server/image-encoders.h server/red-channel.h server/red-worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Oct 20 07:30:22 UTC 2016


 server/cursor-channel-client.c |    6 ------
 server/cursor-channel-client.h |    6 ++++++
 server/cursor-channel.c        |    6 ------
 server/dcc.c                   |    8 ++++----
 server/image-encoders.h        |    9 ++++-----
 server/red-channel.h           |    2 +-
 server/red-worker.c            |    4 ++--
 7 files changed, 17 insertions(+), 24 deletions(-)

New commits:
commit 6f32ec14349b706f4c7e094c54dee6a7832facb3
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Sat Oct 15 00:04:39 2016 +0100

    Declare same enumerator in a single header
    
    Avoid having duplication and desynchronisation.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/cursor-channel-client.c b/server/cursor-channel-client.c
index b7ab2e5..56efd1e 100644
--- a/server/cursor-channel-client.c
+++ b/server/cursor-channel-client.c
@@ -35,12 +35,6 @@
 #define CURSOR_CACHE_HASH_KEY(id) ((id) & CURSOR_CACHE_HASH_MASK)
 #define CURSOR_CLIENT_TIMEOUT 30000000000ULL //nano
 
-enum {
-    RED_PIPE_ITEM_TYPE_CURSOR = RED_PIPE_ITEM_TYPE_COMMON_LAST,
-    RED_PIPE_ITEM_TYPE_CURSOR_INIT,
-    RED_PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE,
-};
-
 G_DEFINE_TYPE(CursorChannelClient, cursor_channel_client, RED_TYPE_CHANNEL_CLIENT)
 
 #define CURSOR_CHANNEL_CLIENT_PRIVATE(o) \
diff --git a/server/cursor-channel-client.h b/server/cursor-channel-client.h
index fab6837..d1dd31d 100644
--- a/server/cursor-channel-client.h
+++ b/server/cursor-channel-client.h
@@ -72,6 +72,12 @@ void cursor_channel_client_on_disconnect(RedChannelClient *rcc);
 RedCacheItem* cursor_channel_client_cache_find(CursorChannelClient *ccc, uint64_t id);
 int cursor_channel_client_cache_add(CursorChannelClient *ccc, uint64_t id, size_t size);
 
+enum {
+    RED_PIPE_ITEM_TYPE_CURSOR = RED_PIPE_ITEM_TYPE_COMMON_LAST,
+    RED_PIPE_ITEM_TYPE_CURSOR_INIT,
+    RED_PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE,
+};
+
 G_END_DECLS
 
 #endif /* CURSOR_CHANNEL_CLIENT_H_ */
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 28a6d54..cfaf55d 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -30,12 +30,6 @@
 
 #define CURSOR_CHANNEL(channel) ((CursorChannel*)(channel))
 
-enum {
-    RED_PIPE_ITEM_TYPE_CURSOR = RED_PIPE_ITEM_TYPE_COMMON_LAST,
-    RED_PIPE_ITEM_TYPE_CURSOR_INIT,
-    RED_PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE,
-};
-
 typedef struct CursorItem {
     QXLInstance *qxl;
     int refs;
commit 14d0ac5fb5c541b1da8cf71718d1512713a6fd24
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Oct 18 10:01:56 2016 +0100

    Move monitors_config_ref inside red_monitors_config_item_new
    
    This makes red_monitors_config_item_new() and
    red_monitors_config_item_free() symmetric.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/dcc.c b/server/dcc.c
index 6aa1977..5c05c3b 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -658,7 +658,7 @@ static RedMonitorsConfigItem *red_monitors_config_item_new(RedChannel* channel,
     RedMonitorsConfigItem *mci;
 
     mci = spice_new(RedMonitorsConfigItem, 1);
-    mci->monitors_config = monitors_config;
+    mci->monitors_config = monitors_config_ref(monitors_config);
 
     red_pipe_item_init_full(&mci->pipe_item, RED_PIPE_ITEM_TYPE_MONITORS_CONFIG,
                             red_monitors_config_item_free);
@@ -682,7 +682,7 @@ void dcc_push_monitors_config(DisplayChannelClient *dcc)
     }
 
     mci = red_monitors_config_item_new(red_channel_client_get_channel(RED_CHANNEL_CLIENT(dcc)),
-                                       monitors_config_ref(dc->priv->monitors_config));
+                                       monitors_config);
     red_channel_client_pipe_add(RED_CHANNEL_CLIENT(dcc), &mci->pipe_item);
     red_channel_client_push(RED_CHANNEL_CLIENT(dcc));
 }
commit cd631b581971c6ff92d6e98a751c602d2f4113f0
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Oct 18 10:01:08 2016 +0100

    dcc: Use spice_new instead of spice_malloc
    
    spice_new return directly the correct type.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/dcc.c b/server/dcc.c
index 0080f10..6aa1977 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -177,7 +177,7 @@ static RedSurfaceCreateItem *red_surface_create_item_new(RedChannel* channel,
 {
     RedSurfaceCreateItem *create;
 
-    create = spice_malloc(sizeof(RedSurfaceCreateItem));
+    create = spice_new(RedSurfaceCreateItem, 1);
 
     create->surface_create.surface_id = surface_id;
     create->surface_create.width = width;
@@ -692,7 +692,7 @@ static RedSurfaceDestroyItem *red_surface_destroy_item_new(RedChannel *channel,
 {
     RedSurfaceDestroyItem *destroy;
 
-    destroy = spice_malloc(sizeof(RedSurfaceDestroyItem));
+    destroy = spice_new(RedSurfaceDestroyItem, 1);
     destroy->surface_destroy.surface_id = surface_id;
     red_pipe_item_init(&destroy->pipe_item, RED_PIPE_ITEM_TYPE_DESTROY_SURFACE);
 
commit da4a0fbe03572611eb4a203e1e4208c1a1b0d768
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Oct 18 10:00:21 2016 +0100

    Fix typo in comment
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/red-channel.h b/server/red-channel.h
index 8818a04..5299646 100644
--- a/server/red-channel.h
+++ b/server/red-channel.h
@@ -358,7 +358,7 @@ struct RedClient {
 
     int disconnecting;
     /* Note that while semi-seamless migration is conducted by the main thread, seamless migration
-     * involves all channels, and thus the related varaibles can be accessed from different
+     * involves all channels, and thus the related variables can be accessed from different
      * threads */
     int during_target_migrate; /* if seamless=TRUE, migration_target is turned off when all
                                   the clients received their migration data. Otherwise (semi-seamless),
commit 18b93e85270ded421696568dadf0ff267ac8102f
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Sep 29 14:30:07 2016 +0100

    Make compression image declarations more similar
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/image-encoders.h b/server/image-encoders.h
index 6542edd..6b4999e 100644
--- a/server/image-encoders.h
+++ b/server/image-encoders.h
@@ -198,15 +198,14 @@ typedef struct compress_send_data_t {
 
 int image_encoders_compress_quic(ImageEncoders *enc, SpiceImage *dest,
                                  SpiceBitmap *src, compress_send_data_t* o_comp_data);
-int image_encoders_compress_lz(ImageEncoders *enc,
-                               SpiceImage *dest, SpiceBitmap *src,
-                               compress_send_data_t* o_comp_data);
+int image_encoders_compress_lz(ImageEncoders *enc, SpiceImage *dest,
+                               SpiceBitmap *src, compress_send_data_t* o_comp_data);
 int image_encoders_compress_jpeg(ImageEncoders *enc, SpiceImage *dest,
                                  SpiceBitmap *src, compress_send_data_t* o_comp_data);
 int image_encoders_compress_lz4(ImageEncoders *enc, SpiceImage *dest,
                                 SpiceBitmap *src, compress_send_data_t* o_comp_data);
-int image_encoders_compress_glz(ImageEncoders *enc,
-                                SpiceImage *dest, SpiceBitmap *src,
+int image_encoders_compress_glz(ImageEncoders *enc, SpiceImage *dest,
+                                SpiceBitmap *src,
                                 RedDrawable *red_drawable,
                                 GlzImageRetention *glz_retention,
                                 compress_send_data_t* o_comp_data,
commit 39b7351d2447a099f0cc36f6c42691d47e5e7402
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Sep 29 14:29:25 2016 +0100

    Reuse SPICE_N_ELEMENTS macro
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/red-worker.c b/server/red-worker.c
index 678856b..40e58f2 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -408,11 +408,11 @@ static void guest_set_client_capabilities(RedWorker *worker)
         red_qxl_set_client_capabilities(worker->qxl, FALSE, caps);
     } else {
         // Take least common denominator
-        for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
+        for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++i) {
             SET_CAP(caps, caps_available[i]);
         }
         FOREACH_CLIENT(worker->display_channel, iter, rcc) {
-            for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
+            for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++i) {
                 if (!red_channel_client_test_remote_cap(rcc, caps_available[i]))
                     CLEAR_CAP(caps, caps_available[i]);
             }


More information about the Spice-commits mailing list