From patchwork Wed Jun 16 07:12:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 55851 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 CBCDF1007D2 for ; Wed, 16 Jun 2010 16:36:17 +1000 (EST) Received: from localhost ([127.0.0.1]:46637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOmEP-0005fz-RD for incoming@patchwork.ozlabs.org; Wed, 16 Jun 2010 02:36:13 -0400 Received: from [140.186.70.92] (port=53368 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOlr1-0001u1-RT for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOlqx-00033G-EB for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:12:03 -0400 Received: from iksaif.net ([88.191.73.63]:35962) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOlqx-00032z-74 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:11:59 -0400 Received: from tartiflon (lal69-3-82-241-209-44.fbx.proxad.net [82.241.209.44]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id 632F6C9001F; Wed, 16 Jun 2010 08:16:20 +0200 (CEST) From: Corentin Chary To: qemu-devel@nongnu.org Date: Wed, 16 Jun 2010 09:12:12 +0200 Message-Id: <1276672333-14831-16-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1276672333-14831-1-git-send-email-corentincj@iksaif.net> References: <1276672333-14831-1-git-send-email-corentincj@iksaif.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Corentin Chary , Anthony Liguori , Alexander Graf Subject: [Qemu-devel] [PATCH 15/16] vnc: add missing lock for vnc_cursor_define() 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 All vnc_write() calls must be locked (except the ones present before the protocol initialization). Signed-off-by: Corentin Chary --- ui/vnc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index cffe238..61f9a05 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -794,6 +794,7 @@ static int vnc_cursor_define(VncState *vs) int isize; if (vnc_has_feature(vs, VNC_FEATURE_RICH_CURSOR)) { + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); /* padding */ vnc_write_u16(vs, 1); /* # of rects */ @@ -802,6 +803,7 @@ static int vnc_cursor_define(VncState *vs) isize = c->width * c->height * vs->clientds.pf.bytes_per_pixel; vnc_write_pixels_generic(vs, &pf, c->data, isize); vnc_write(vs, vs->vd->cursor_mask, vs->vd->cursor_msize); + vnc_unlock_output(vs); return 0; } return -1;