From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAEO3-0007sI-Al for qemu-devel@nongnu.org; Thu, 24 Jul 2014 04:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAENv-0003bg-71 for qemu-devel@nongnu.org; Thu, 24 Jul 2014 04:28:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAENu-0003bW-Tc for qemu-devel@nongnu.org; Thu, 24 Jul 2014 04:28:19 -0400 From: Gerd Hoffmann Date: Thu, 24 Jul 2014 10:28:06 +0200 Message-Id: <1406190486-16026-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1406190486-16026-1-git-send-email-kraxel@redhat.com> References: <1406190486-16026-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL for-2.1 2/2] vnc update fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori We need to remember has_updates for each vnc client. Otherwise it might happen that vnc_update_client(has_dirty=1) takes the first exit due to output buffers not being flushed yet and subsequent calls with has_dirty=0 take the second exit, wrongly assuming there is nothing to do because the work defered in the first call is ignored. Signed-off-by: Gerd Hoffmann Reviewed-by: Peter Lieven --- ui/vnc.c | 4 +++- ui/vnc.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 06d6ca0..f8d9b7d 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -887,6 +887,7 @@ static int find_and_clear_dirty_height(struct VncState *vs, static int vnc_update_client(VncState *vs, int has_dirty, bool sync) { + vs->has_dirty += has_dirty; if (vs->need_update && vs->csock != -1) { VncDisplay *vd = vs->vd; VncJob *job; @@ -898,7 +899,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) /* kernel send buffers are full -> drop frames to throttle */ return 0; - if (!has_dirty && !vs->audio_cap && !vs->force_update) + if (!vs->has_dirty && !vs->audio_cap && !vs->force_update) return 0; /* @@ -941,6 +942,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) vnc_jobs_join(vs); } vs->force_update = 0; + vs->has_dirty = 0; return n; } diff --git a/ui/vnc.h b/ui/vnc.h index 8f582fd..334de9d 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -263,6 +263,7 @@ struct VncState VncDisplay *vd; int need_update; int force_update; + int has_dirty; uint32_t features; int absolute; int last_x; -- 1.8.3.1