From patchwork Thu Aug 27 10:18:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 511220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 52D1114010F for ; Thu, 27 Aug 2015 20:21:17 +1000 (AEST) Received: from localhost ([::1]:35450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUuJ1-0004M2-Fg for incoming@patchwork.ozlabs.org; Thu, 27 Aug 2015 06:21:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUuH8-0001kS-9s for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUuH4-0000zR-NB for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:18 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:35464 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUuH4-0000yP-9F for qemu-devel@nongnu.org; Thu, 27 Aug 2015 06:19:14 -0400 Received: (qmail 5957 invoked by uid 89); 27 Aug 2015 10:19:13 -0000 Received: from [82.141.1.145] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.98.7/20842. hbedv: 8.3.34.4/7.12.2.196. spamassassin: 3.4.0. Clear:RC:1(82.141.1.145):SA:0(-1.2/5.0):. Processed in 2.596301 secs); 27 Aug 2015 10:19:13 -0000 Received: from ns.kamp-intra.net (HELO dns.kamp-intra.net) ([82.141.1.145]) by mx01.kamp.de with SMTP; 27 Aug 2015 10:19:09 -0000 X-GL_Whitelist: yes Received: from lieven-pc (lieven-pc.kamp-intra.net [172.21.12.60]) by dns.kamp-intra.net (Postfix) with ESMTP id 79EA0E0069; Thu, 27 Aug 2015 12:19:09 +0200 (CEST) Received: by lieven-pc (Postfix, from userid 1000) id 5A32320D16; Thu, 27 Aug 2015 12:19:01 +0200 (CEST) From: Peter Lieven To: qemu-devel@nongnu.org Date: Thu, 27 Aug 2015 12:18:53 +0200 Message-Id: <1440670734-5616-4-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440670734-5616-1-git-send-email-pl@kamp.de> References: <1440670734-5616-1-git-send-email-pl@kamp.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:248:0:51::16 Cc: Peter Lieven , kraxel@redhat.com Subject: [Qemu-devel] [PATCH 3/4] vnc-jobs: move buffer_reset to vnc_async_encoding_end 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 now that we are able to shrink the buffer it makes sense to move the buffer_reset to vnc_async_encoding_end to actually shrink the buffer when it is no longer used. Signed-off-by: Peter Lieven --- ui/vnc-jobs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index 22c9abc..201d9b7 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -195,8 +195,6 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local) local->zrle = orig->zrle; local->output = queue->buffer; local->csock = -1; /* Don't do any network work on this thread */ - - buffer_reset(&local->output); } static void vnc_async_encoding_end(VncState *orig, VncState *local) @@ -208,6 +206,7 @@ static void vnc_async_encoding_end(VncState *orig, VncState *local) orig->lossy_rect = local->lossy_rect; queue->buffer = local->output; + buffer_reset(&queue->buffer); } static int vnc_worker_thread_loop(VncJobQueue *queue)