spice/0003-Process-outstanding-commands-in-the-ring-after-chang.patch

35 lines
1.3 KiB
Diff
Raw Normal View History

From f5145d9185d02c597672d5fd65420d5ffc692b4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= <ssp@redhat.com>
Date: Sat, 1 Sep 2012 11:13:49 -0400
Subject: [PATCH 3/5] Process outstanding commands in the ring after changing capability bits
When a new client connects, there may be commands in the ring that it
can't understand, so we need to process these before forwarding new
commands to the client. By doing this after changing the capability
bits we ensure that the new client will never see a command that it
doesn't understand (under the assumption that the guest will read and
obey the capability bits).
---
server/red_worker.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/server/red_worker.c b/server/red_worker.c
index 1e301c4..75bc045 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -9478,6 +9478,11 @@ static void on_new_display_channel_client(DisplayChannelClient *dcc)
}
red_channel_client_ack_zero_messages_window(&dcc->common.base);
if (worker->surfaces[0].context.canvas) {
+ int ring_is_empty;
+
+ while (red_process_commands(worker, MAX_PIPE_SIZE, &ring_is_empty)) {
+ }
+
red_current_flush(worker, 0);
push_new_primary_surface(dcc);
red_push_surface_image(dcc, 0);
--
1.7.4