From: Corentin Chary Date: Fri, 4 Feb 2011 08:05:53 +0000 (+0100) Subject: vnc: qemu can die if the client is disconnected while updating screen X-Git-Tag: v0.14.0-rc1~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=602c075070f113c69c2100776f7a67cee55dd61e;p=thirdparty%2Fqemu.git 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 Signed-off-by: Anthony Liguori (cherry picked from commit 73eb4c04e9e8ea7f6eb83694cb0c43e38d882a7c) --- diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c index 6e9cf08b694..0b5d750f268 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; }