[Spice-commits] server/cursor-channel.c server/dcc.c server/dcc.h server/red-worker.c server/red-worker.h

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Dec 14 02:54:25 PST 2015


 server/cursor-channel.c |    2 +-
 server/dcc.c            |    4 ++--
 server/dcc.h            |    1 -
 server/red-worker.c     |    8 ++++----
 server/red-worker.h     |    2 +-
 5 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit cbc4e07682a8a40f8d270e7a092973ac4f93f36d
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Dec 14 10:52:43 2015 +0000

    server: Rename DISPLAY_CLIENT_TIMEOUT and de-duplicate it
    
    Given that it is used for both cursor and display, COMMON_CLIENT_TIMEOUT
    seems more appropriate. Also define it only in red-worker.h.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 840ff30..ec994e3 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -549,7 +549,7 @@ void cursor_channel_reset(CursorChannel *cursor)
             red_pipes_add_verb(channel, SPICE_MSG_CURSOR_RESET);
         }
         if (!red_channel_wait_all_sent(&cursor->common.base,
-                                       DISPLAY_CLIENT_TIMEOUT)) {
+                                       COMMON_CLIENT_TIMEOUT)) {
             red_channel_apply_clients(channel,
                                       red_channel_client_disconnect_if_pending_send);
         }
diff --git a/server/dcc.c b/server/dcc.c
index f47cbec..b2ee7a6 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -123,7 +123,7 @@ int dcc_clear_surface_drawables_from_pipe(DisplayChannelClient *dcc, int surface
 
     if (item) {
         return red_channel_client_wait_pipe_item_sent(RED_CHANNEL_CLIENT(dcc), item,
-                                                      DISPLAY_CLIENT_TIMEOUT);
+                                                      COMMON_CLIENT_TIMEOUT);
     } else {
         /*
          * in case that the pipe didn't contain any item that is dependent on the surface, but
@@ -415,7 +415,7 @@ static void dcc_create_all_streams(DisplayChannelClient *dcc)
 static int display_channel_client_wait_for_init(DisplayChannelClient *dcc)
 {
     dcc->expect_init = TRUE;
-    uint64_t end_time = spice_get_monotonic_time_ns() + DISPLAY_CLIENT_TIMEOUT;
+    uint64_t end_time = spice_get_monotonic_time_ns() + COMMON_CLIENT_TIMEOUT;
     for (;;) {
         red_channel_client_receive(RED_CHANNEL_CLIENT(dcc));
         if (!red_channel_client_is_connected(RED_CHANNEL_CLIENT(dcc))) {
diff --git a/server/dcc.h b/server/dcc.h
index f9703be..9d88b90 100644
--- a/server/dcc.h
+++ b/server/dcc.h
@@ -31,7 +31,6 @@
 #define PALETTE_CACHE_HASH_KEY(id) ((id) & PALETTE_CACHE_HASH_MASK)
 #define CLIENT_PALETTE_CACHE_SIZE 128
 
-#define DISPLAY_CLIENT_TIMEOUT 30000000000ULL //nano
 #define DISPLAY_CLIENT_MIGRATE_DATA_TIMEOUT 10000000000ULL //nano, 10 sec
 #define DISPLAY_CLIENT_RETRY_INTERVAL 10000 //micro
 
diff --git a/server/red-worker.c b/server/red-worker.c
index 37d19cd..f0de17e 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -397,7 +397,7 @@ static void flush_display_commands(RedWorker *worker)
         if (ring_is_empty) {
             break;
         }
-        end_time = spice_get_monotonic_time_ns() + DISPLAY_CLIENT_TIMEOUT;
+        end_time = spice_get_monotonic_time_ns() + COMMON_CLIENT_TIMEOUT;
         int sleep_count = 0;
         for (;;) {
             red_channel_push(RED_CHANNEL(worker->display_channel));
@@ -441,7 +441,7 @@ static void flush_cursor_commands(RedWorker *worker)
         if (ring_is_empty) {
             break;
         }
-        end_time = spice_get_monotonic_time_ns() + DISPLAY_CLIENT_TIMEOUT;
+        end_time = spice_get_monotonic_time_ns() + COMMON_CLIENT_TIMEOUT;
         int sleep_count = 0;
         for (;;) {
             red_channel_push(RED_CHANNEL(worker->cursor_channel));
@@ -952,12 +952,12 @@ static void handle_dev_stop(void *opaque, void *payload)
      * to the client (there is no such message right now), and start
      * from scratch on the destination side */
     if (!red_channel_wait_all_sent(RED_CHANNEL(worker->display_channel),
-                                   DISPLAY_CLIENT_TIMEOUT)) {
+                                   COMMON_CLIENT_TIMEOUT)) {
         red_channel_apply_clients(RED_CHANNEL(worker->display_channel),
                                  red_channel_client_disconnect_if_pending_send);
     }
     if (!red_channel_wait_all_sent(RED_CHANNEL(worker->cursor_channel),
-                                   DISPLAY_CLIENT_TIMEOUT)) {
+                                   COMMON_CLIENT_TIMEOUT)) {
         red_channel_apply_clients(RED_CHANNEL(worker->cursor_channel),
                                  red_channel_client_disconnect_if_pending_send);
     }
diff --git a/server/red-worker.h b/server/red-worker.h
index 44f35f7..e6ad8cf 100644
--- a/server/red-worker.h
+++ b/server/red-worker.h
@@ -33,7 +33,7 @@ typedef struct CommonChannelClient {
 } CommonChannelClient;
 
 #define COMMON_CHANNEL_CLIENT(Client) ((CommonChannelClient*)(Client))
-#define DISPLAY_CLIENT_TIMEOUT 30000000000ULL //nano
+#define COMMON_CLIENT_TIMEOUT 30000000000ULL //nano
 
 #define CHANNEL_RECEIVE_BUF_SIZE 1024
 typedef struct CommonChannel {


More information about the Spice-commits mailing list