[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/25] ui: fix refresh of VNC server surface
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 02/25] ui: fix refresh of VNC server surface |
Date: |
Tue, 20 Sep 2016 12:05:18 -0500 |
From: "Daniel P. Berrange" <address@hidden>
In previous commit
commit c7628bff4138ce906a3620d12e0820c1cf6c140d
Author: Gerd Hoffmann <address@hidden>
Date: Fri Oct 30 12:10:09 2015 +0100
vnc: only alloc server surface with clients connected
the VNC server was changed so that the 'vd->server' pixman
image was only allocated when a client is connected.
Since then if a client disconnects and then reconnects to
the VNC server all they will see is a black screen until
they do something that triggers a refresh. On a graphical
desktop this is not often noticed since there's many things
going on which cause a refresh. On a plain text console it
is really obvious since nothing refreshes frequently.
The problem is that the VNC server didn't update the guest
dirty bitmap, so still believes its server image is in sync
with the guest contents.
To fix this we must explicitly mark the entire guest desktop
as dirty after re-creating the server surface. Move this
logic into vnc_update_server_surface() so it is guaranteed
to be call in all code paths that re-create the surface
instead of only in vnc_dpy_switch()
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Peter Lieven <address@hidden>
Tested-by: Peter Lieven <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
(cherry picked from commit b69a553b4af9bc87a8b2e0a7b7a7de4cc7f0557e)
Signed-off-by: Michael Roth <address@hidden>
---
ui/vnc.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index 3e89dad..78a586f 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -687,6 +687,8 @@ void *vnc_server_fb_ptr(VncDisplay *vd, int x, int y)
static void vnc_update_server_surface(VncDisplay *vd)
{
+ int width, height;
+
qemu_pixman_image_unref(vd->server);
vd->server = NULL;
@@ -694,10 +696,15 @@ static void vnc_update_server_surface(VncDisplay *vd)
return;
}
+ width = vnc_width(vd);
+ height = vnc_height(vd);
vd->server = pixman_image_create_bits(VNC_SERVER_FB_FORMAT,
- vnc_width(vd),
- vnc_height(vd),
+ width, height,
NULL, 0);
+
+ memset(vd->guest.dirty, 0x00, sizeof(vd->guest.dirty));
+ vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0,
+ width, height);
}
static void vnc_dpy_switch(DisplayChangeListener *dcl,
@@ -705,7 +712,6 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
{
VncDisplay *vd = container_of(dcl, VncDisplay, dcl);
VncState *vs;
- int width, height;
vnc_abort_display_jobs(vd);
vd->ds = surface;
@@ -717,11 +723,6 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(surface->image);
vd->guest.format = surface->format;
- width = vnc_width(vd);
- height = vnc_height(vd);
- memset(vd->guest.dirty, 0x00, sizeof(vd->guest.dirty));
- vnc_set_area_dirty(vd->guest.dirty, vd, 0, 0,
- width, height);
QTAILQ_FOREACH(vs, &vd->clients, next) {
vnc_colordepth(vs);
@@ -731,7 +732,8 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
}
memset(vs->dirty, 0x00, sizeof(vs->dirty));
vnc_set_area_dirty(vs->dirty, vd, 0, 0,
- width, height);
+ vnc_width(vd),
+ vnc_height(vd));
}
}
--
1.9.1
- [Qemu-devel] [PATCH 10/25] 9pfs: handle walk of ".." in the root directory, (continued)
- [Qemu-devel] [PATCH 10/25] 9pfs: handle walk of ".." in the root directory, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 12/25] virtio-balloon: discard virtqueue element on reset, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 13/25] vnc: fix qemu crash because of SIGSEGV, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 14/25] 9pfs: fix potential segfault during walk, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 15/25] scsi: mptsas: use g_new0 to allocate MPTSASRequest object, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 22/25] crypto: ensure XTS is only used with ciphers with 16 byte blocks, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 16/25] scsi: pvscsi: limit process IO loop to ring size, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 18/25] scsi-disk: change disk serial length from 20 to 36, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 17/25] qemu-char: avoid segfault if user lacks of permisson of a given logfile, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 20/25] scsi: mptconfig: fix an assert expression, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 02/25] ui: fix refresh of VNC server surface,
Michael Roth <=
- [Qemu-devel] [PATCH 19/25] vmw_pvscsi: check page count while initialising descriptor rings, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 03/25] virtio: recalculate vq->inuse after migration, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 21/25] scsi: mptconfig: fix misuse of MPTSAS_CONFIG_PACK, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 24/25] scsi-disk: Cleaning up around tray open state, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 08/25] 9pfs: forbid illegal path names, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 07/25] net: vmxnet: use g_new for pkt initialisation, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 04/25] virtio: decrement vq->inuse in virtqueue_discard(), Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 06/25] net: vmxnet: check IP header length, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 25/25] virtio-scsi: Don't abort when media is ejected, Michael Roth, 2016/09/20
- [Qemu-devel] [PATCH 23/25] iothread: Stop threads before main() quits, Michael Roth, 2016/09/20