From patchwork Wed Jul 7 18:58:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 58159 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 29AA5B6ED0 for ; Thu, 8 Jul 2010 05:38:06 +1000 (EST) Received: from localhost ([127.0.0.1]:33188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWaIN-0007Gw-Gt for incoming@patchwork.ozlabs.org; Wed, 07 Jul 2010 15:28:35 -0400 Received: from [140.186.70.92] (port=35036 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWZol-000884-0R for qemu-devel@nongnu.org; Wed, 07 Jul 2010 14:58:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWZoc-0002go-MM for qemu-devel@nongnu.org; Wed, 07 Jul 2010 14:57:58 -0400 Received: from iksaif.net ([88.191.73.63]:35198) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWZoc-0002g1-Bv for qemu-devel@nongnu.org; Wed, 07 Jul 2010 14:57:50 -0400 Received: from falgoret.iksaif.net (localhost [127.0.0.1]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id BA6E4C9008D; Wed, 7 Jul 2010 20:58:14 +0200 (CEST) From: Corentin Chary To: qemu-devel@nongnu.org Date: Wed, 7 Jul 2010 20:58:03 +0200 Message-Id: <1278529086-10391-16-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1278529086-10391-1-git-send-email-corentincj@iksaif.net> References: <1278529086-10391-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 v2 15/18] 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 7330b2c..7fc40ac 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -796,6 +796,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 */ @@ -804,6 +805,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;