[Spice-devel] [PATCH spice-server 3/8] replay: Replicate properly wakeups
Frediano Ziglio
fziglio at redhat.com
Fri Nov 4 13:16:23 UTC 2016
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 at redhat.com>
---
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
More information about the Spice-devel
mailing list