[Spice-devel] [PATCH v2 13/40] server: use red_channel_get_message_serial

Alon Levy alevy at redhat.com
Wed Mar 2 00:31:36 PST 2011


---
 server/red_client_shared_cache.h |    6 +++---
 server/red_worker.c              |    7 +------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/server/red_client_shared_cache.h b/server/red_client_shared_cache.h
index 75112c3..74553c0 100644
--- a/server/red_client_shared_cache.h
+++ b/server/red_client_shared_cache.h
@@ -40,7 +40,7 @@ static int FUNC_NAME(hit)(CACHE *cache, uint64_t id, int *lossy, CHANNEL *channe
     NewCacheItem *item;
     uint64_t serial;
 
-    serial = channel_message_serial((RedChannel *)channel);
+    serial = red_channel_get_message_serial((RedChannel *)channel);
     pthread_mutex_lock(&cache->lock);
     item = cache->hash_table[CACHE_HASH_KEY(id)];
 
@@ -88,7 +88,7 @@ static int FUNC_NAME(add)(CACHE *cache, uint64_t id, uint32_t size, int lossy, C
     ASSERT(size > 0);
 
     item = spice_new(NewCacheItem, 1);
-    serial = channel_message_serial((RedChannel *)channel);
+    serial = red_channel_get_message_serial((RedChannel *)channel);
 
     pthread_mutex_lock(&cache->lock);
 
@@ -172,7 +172,7 @@ static void FUNC_NAME(reset)(CACHE *cache, CHANNEL *channel, SpiceMsgWaitForChan
     uint64_t serial;
     uint32_t i;
 
-    serial = channel_message_serial((RedChannel *)channel);
+    serial = red_channel_get_message_serial((RedChannel *)channel);
     pthread_mutex_lock(&cache->lock);
     PRIVATE_FUNC_NAME(clear)(cache);
 
diff --git a/server/red_worker.c b/server/red_worker.c
index ed15eda..adf73a1 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1259,11 +1259,6 @@ static inline void red_pipe_add_image_item_after(RedWorker *worker, ImageItem *i
     red_channel_pipe_add_after(&worker->display_channel->common.base, &item->link, pos);
 }
 
-static inline uint64_t channel_message_serial(RedChannel *channel)
-{
-    return channel->send_data.header->serial;
-}
-
 static void release_image_item(ImageItem *item)
 {
     if (!--item->refs) {
@@ -7626,7 +7621,7 @@ static void display_channel_send_migrate_data(DisplayChannel *display_channel)
     ASSERT(MAX_CACHE_CLIENTS == 4); //MIGRATE_DATA_VERSION dependent
     display_data.version = DISPLAY_MIGRATE_DATA_VERSION;
 
-    display_data.message_serial = channel_message_serial((RedChannel *)display_channel);
+    display_data.message_serial = red_channel_get_message_serial((RedChannel *)display_channel);
 
     display_data.pixmap_cache_freezer = pixmap_cache_freeze(display_channel->pixmap_cache);
     display_data.pixmap_cache_id = display_channel->pixmap_cache->id;
-- 
1.7.4.1



More information about the Spice-devel mailing list