[Qemu-devel] [PATCH] vnc: fix update stalls

Gerd Hoffmann posted 1 patch 6 years, 8 months ago
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190305130930.24516-1-kraxel@redhat.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc.c | 6 ++++++
1 file changed, 6 insertions(+)
[Qemu-devel] [PATCH] vnc: fix update stalls
Posted by Gerd Hoffmann 6 years, 8 months ago
vnc aborts display update jobs on video mode switches and page flips.
That can cause vnc update stalls in case an unfinished vnc job gets
aborted.  The vnc client will never receive the requested update then.
Fix that by copying the state from job_update back to update in that
case.

Reports complain about stalls with two or more clients being connected
at the same time, on some but not all connections.  I suspect it can
also happen with a single connection, multiple connections only make
this more much likely to happen.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1662260
Reported-by: Ying Fang <fangying1@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/vnc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ui/vnc.c b/ui/vnc.c
index da4a21d4ce94..2f2ab62fcf71 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -700,6 +700,12 @@ static void vnc_abort_display_jobs(VncDisplay *vd)
     }
     QTAILQ_FOREACH(vs, &vd->clients, next) {
         vnc_lock_output(vs);
+        if (vs->update == VNC_STATE_UPDATE_NONE &&
+            vs->job_update != VNC_STATE_UPDATE_NONE) {
+            /* job aborted before completion */
+            vs->update = vs->job_update;
+            vs->job_update = VNC_STATE_UPDATE_NONE;
+        }
         vs->abort = false;
         vnc_unlock_output(vs);
     }
-- 
2.18.1


Re: [Qemu-devel] [PATCH] vnc: fix update stalls
Posted by Ying Fang 6 years, 8 months ago
On 2019/3/5 21:09, Gerd Hoffmann wrote:
> vnc aborts display update jobs on video mode switches and page flips.
> That can cause vnc update stalls in case an unfinished vnc job gets
> aborted.  The vnc client will never receive the requested update then.
> Fix that by copying the state from job_update back to update in that
> case.
> 
> Reports complain about stalls with two or more clients being connected
> at the same time, on some but not all connections.  I suspect it can
> also happen with a single connection, multiple connections only make
> this more much likely to happen.
> 
> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1662260
> Reported-by: Ying Fang <fangying1@huawei.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Ying Fang <fangying1@huawei.com>

> ---
>  ui/vnc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/ui/vnc.c b/ui/vnc.c
> index da4a21d4ce94..2f2ab62fcf71 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -700,6 +700,12 @@ static void vnc_abort_display_jobs(VncDisplay *vd)
>      }
>      QTAILQ_FOREACH(vs, &vd->clients, next) {
>          vnc_lock_output(vs);
> +        if (vs->update == VNC_STATE_UPDATE_NONE &&
> +            vs->job_update != VNC_STATE_UPDATE_NONE) {
> +            /* job aborted before completion */
> +            vs->update = vs->job_update;
> +            vs->job_update = VNC_STATE_UPDATE_NONE;
> +        }
>          vs->abort = false;
>          vnc_unlock_output(vs);
>      }
>