[PATCH spice-server 3/8] replay: Replicate properly wakeups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of waking up the command loop for every command queued
handle saved wakeups and replicate these.
This better reproduce what happened in the server.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red-replay-qxl.c | 2 +-
 server/tests/replay.c   | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 0ab87d4..680e212 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -1279,7 +1279,7 @@ static void replay_handle_dev_input(QXLWorker *worker, SpiceReplay *replay,
         // we want to ignore this one - it is sent on client connection, we
         // shall have our own clients
     case RED_WORKER_MESSAGE_WAKEUP:
-        // safe to ignore
+        worker->wakeup(worker);
         break;
     default:
         spice_debug("unhandled %d\n", message);
diff --git a/server/tests/replay.c b/server/tests/replay.c
index 6c6e01e..3a0d515 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -111,7 +111,6 @@ static void get_init_info(QXLInstance *qin, QXLDevInitInfo *info)
 static gboolean fill_queue_idle(gpointer user_data)
 {
     gboolean keep = FALSE;
-    gboolean wakeup = FALSE;
 
     while ((g_async_queue_length(display_queue) +
             g_async_queue_length(cursor_queue)) < 50) {
@@ -128,7 +127,6 @@ static gboolean fill_queue_idle(gpointer user_data)
             g_usleep(slow);
         }
 
-        wakeup = TRUE;
         if (cmd->cmd.type == QXL_CMD_CURSOR) {
             g_async_queue_push(cursor_queue, cmd);
         } else {
@@ -146,8 +144,6 @@ end:
         }
         pthread_mutex_unlock(&mutex);
     }
-    if (wakeup)
-        spice_qxl_wakeup(&display_sin);
 
     return keep;
 }
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]