From patchwork Mon May 7 13:58:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hahn X-Patchwork-Id: 157323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id ADAA0B6FA7 for ; Tue, 8 May 2012 00:10:14 +1000 (EST) Received: from localhost ([::1]:50042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SROdg-0007HY-Dh for incoming@patchwork.ozlabs.org; Mon, 07 May 2012 10:10:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SROdP-0006vq-Qj for qemu-devel@nongnu.org; Mon, 07 May 2012 10:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SROdN-00021T-Vp for qemu-devel@nongnu.org; Mon, 07 May 2012 10:09:55 -0400 Received: from mail.univention.de ([82.198.197.8]:2175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SROdN-0001yq-PV for qemu-devel@nongnu.org; Mon, 07 May 2012 10:09:53 -0400 Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id 32446769101; Mon, 7 May 2012 16:09:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id 23F0A164B10C; Mon, 7 May 2012 16:09:51 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.1 (20080629) (Debian) at knut.univention.de Received: from mail.univention.de ([127.0.0.1]) by localhost (slugis.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E4vwH2zoi+jo; Mon, 7 May 2012 16:09:50 +0200 (CEST) Received: from stave.knut.univention.de (mail.univention.de [82.198.197.8]) by slugis.knut.univention.de (Postfix) with ESMTPSA id D5FAD769101; Mon, 7 May 2012 16:09:50 +0200 (CEST) Message-Id: From: Philipp Hahn Date: Mon, 7 May 2012 15:58:21 +0200 Organization: Univention GmbH, Bremen, Germany To: qemu-devel@nongnu.org, Anthony Liguori X-UID: 44 X-Length: 1656 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 82.198.197.8 Subject: [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Only print the error message once per change and also include the actual unsupported color depth in bytes per pixel in the error message. Signed-off-by: Philipp Hahn --- ui/vnc.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index deb9ecd..9dcff9b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -641,6 +641,7 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf, void *pixels1, int size) { uint8_t buf[4]; + static uint8_t last_error_bpp = 4; /* any of the supported formats */ if (pf->bytes_per_pixel == 4) { uint32_t *pixels = pixels1; @@ -667,7 +668,12 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf, vnc_write(vs, buf, vs->clientds.pf.bytes_per_pixel); } } else { - fprintf(stderr, "vnc_write_pixels_generic: VncState color depth not supported\n"); + if (last_error_bpp != pf->bytes_per_pixel) { + last_error_bpp = pf->bytes_per_pixel; + fprintf(stderr, + "vnc_write_pixels_generic: VncState color depth %d not supported\n", + pf->bytes_per_pixel); + } } }