From patchwork Tue Jan 25 08:33:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 80334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7E749B708B for ; Tue, 25 Jan 2011 19:35:51 +1100 (EST) Received: from localhost ([127.0.0.1]:40310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PheNQ-0004oJ-Lf for incoming@patchwork.ozlabs.org; Tue, 25 Jan 2011 03:35:48 -0500 Received: from [140.186.70.92] (port=36663 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PheLe-0004ct-Jr for qemu-devel@nongnu.org; Tue, 25 Jan 2011 03:34:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PheLJ-0001fZ-4F for qemu-devel@nongnu.org; Tue, 25 Jan 2011 03:33:58 -0500 Received: from smtp1.tech.numericable.fr ([82.216.111.37]:40312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PheLI-0001fL-Vc for qemu-devel@nongnu.org; Tue, 25 Jan 2011 03:33:37 -0500 Received: from localhost.localdomain (ip-71.net-81-220-210.rev.numericable.fr [81.220.210.71]) by smtp1.tech.numericable.fr (Postfix) with ESMTP id 6A839E0826; Tue, 25 Jan 2011 09:33:36 +0100 (CET) From: Corentin Chary To: Anthony Liguori Date: Tue, 25 Jan 2011 09:33:27 +0100 Message-Id: <1295944407-19680-3-git-send-email-corentin.chary@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1295902845-29807-3-git-send-email-aliguori@us.ibm.com> References: <1295902845-29807-3-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Corentin Chary , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/2] vnc: qemu can die if the client is disconnected while updating screen X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Corentin Chary agraf reported that qemu_mutex_destroy(vs->output_mutex) was failing in vnc_disconnect_finish() when the vnc client was disconnected while updating the screen. It's because vnc_worker_thread_loop() tries to unlock the mutex while not locked. Signed-off-by: Corentin Chary --- ui/vnc-jobs-async.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c index 6e9cf08..0b5d750 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; }