From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SROpi-0003Ee-KW for qemu-devel@nongnu.org; Mon, 07 May 2012 10:22:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SROpc-0006of-DP for qemu-devel@nongnu.org; Mon, 07 May 2012 10:22:38 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:43661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SROpc-0006o2-71 for qemu-devel@nongnu.org; Mon, 07 May 2012 10:22:32 -0400 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 May 2012 08:22:26 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 29D9719D8050 for ; Mon, 7 May 2012 08:21:31 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q47EL0BE125174 for ; Mon, 7 May 2012 08:21:12 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q47EKjTe026147 for ; Mon, 7 May 2012 08:20:45 -0600 Message-ID: <4FA7DA0D.6030303@us.ibm.com> Date: Mon, 07 May 2012 09:19:57 -0500 From: Anthony Liguori MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philipp Hahn Cc: qemu-devel@nongnu.org On 05/07/2012 08:58 AM, Philipp Hahn wrote: > 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 Under what conditions are you seeing this happen? Regards, Anthony Liguori > --- > 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); > + } > } > } >