summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2011-02-04 09:05:53 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-02-04 06:33:26 -0600
commit73eb4c04e9e8ea7f6eb83694cb0c43e38d882a7c (patch)
tree1b93f15ea46970f9a9ff1e5c837b8be2e62602e0 /ui
parent7185f9315bcf90e99b123370cf4d19b8c20afbd5 (diff)
downloadqemu-73eb4c04e9e8ea7f6eb83694cb0c43e38d882a7c.tar.gz
vnc: qemu can die if the client is disconnected while updating screen
agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing in vnc_disconnect_finish(). It's because vnc_worker_thread_loop() tries to unlock the mutex while not locked. The unlocking call doesn't fail (pthread bug ?), but the destroy call does. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc-jobs-async.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
index 6e9cf08b69..0b5d750f26 100644
--- a/ui/vnc-jobs-async.c
+++ b/ui/vnc-jobs-async.c
@@ -227,6 +227,10 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
if (job->vs->csock == -1) {
vnc_unlock_display(job->vs->vd);
+ /* output mutex must be locked before going to
+ * disconnected:
+ */
+ vnc_lock_output(job->vs);
goto disconnected;
}