From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXSA5-0006He-7h for qemu-devel@nongnu.org; Thu, 03 Sep 2015 06:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXSA0-0005YO-8Z for qemu-devel@nongnu.org; Thu, 03 Sep 2015 06:54:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXSA0-0005YK-2w for qemu-devel@nongnu.org; Thu, 03 Sep 2015 06:54:28 -0400 Message-ID: <1441277665.557.48.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 03 Sep 2015 12:54:25 +0200 In-Reply-To: <55E81C09.9020504@kamp.de> References: <1440670734-5616-1-git-send-email-pl@kamp.de> <1440670734-5616-5-git-send-email-pl@kamp.de> <1441274259.557.22.camel@redhat.com> <55E81C09.9020504@kamp.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] vnc: destroy server surface if no client is connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: qemu-devel@nongnu.org On Do, 2015-09-03 at 12:08 +0200, Peter Lieven wrote: > Am 03.09.2015 um 11:57 schrieb Gerd Hoffmann: > > On Do, 2015-08-27 at 12:18 +0200, Peter Lieven wrote: > >> if no client is connected there is no need to keep the server > >> surface. Throw it away and replace it with a dummy surface to > >> save memory. > > No dummy surface please. Just set vd->server = NULL. > > I can do that, but I have to check for vd->server == NULL at some points then. Sure. That'll shortcut code paths which should not have any effect anyway. You probably also want factor out server surface initialization into a function which is called for both first vnc connect and surface changes. Oh, and btw: in case the surface changes without resolution/depth changing (guest page flip) we might simply skip surface (re-)initialization. cheers, Gerd