]> git.proxmox.com Git - qemu.git/commitdiff
vnc: qemu can die if the client is disconnected while updating screen
authorCorentin Chary <corentincj@iksaif.net>
Fri, 4 Feb 2011 08:05:53 +0000 (09:05 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 4 Feb 2011 12:33:26 +0000 (06:33 -0600)
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>
ui/vnc-jobs-async.c

index 6e9cf08b6943223c5537671961ad581c4a4252df..0b5d750f268eb4ec6878eda99d6d384a95c70c6b 100644 (file)
@@ -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;
         }