Received: from eggs.gnu.org ([208.118.235.92]:45918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8ank-0000jj-Dl for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8ane-0003Xz-5P for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:51:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8and-0003WB-S2 for qemu-devel@nongnu.org; Mon, 03 Sep 2012 13:51:02 -0400 From: =?UTF-8?q?S=C3=B8ren=20Sandmann?= Date: Mon, 3 Sep 2012 13:53:53 -0400 Message-Id: <1346694835-23590-3-git-send-email-sandmann@cs.au.dk> In-Reply-To: <1346694835-23590-1-git-send-email-sandmann@cs.au.dk> References: <1346694835-23590-1-git-send-email-sandmann@cs.au.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 3/5] Process outstanding commands in the ring after changing capability bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: spice-devel@freedesktop.org, qemu-devel@nongnu.org Cc: =?UTF-8?q?S=C3=B8ren=20Sandmann=20Pedersen?= From: S=C3=B8ren Sandmann Pedersen 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 60b5471..f87967c 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -9493,6 +9493,11 @@ static void on_new_display_channel_client(DisplayC= hannelClient *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_empt= y)) { + } + =20 red_current_flush(worker, 0); push_new_primary_surface(dcc); red_push_surface_image(dcc, 0); --=20 1.7.4