From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IdAFF-0008Fh-5T for qemu-devel@nongnu.org; Wed, 03 Oct 2007 15:50:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IdAFD-0008FH-EJ for qemu-devel@nongnu.org; Wed, 03 Oct 2007 15:50:56 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IdAFD-0008FE-7s for qemu-devel@nongnu.org; Wed, 03 Oct 2007 15:50:55 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IdAFC-00048L-RU for qemu-devel@nongnu.org; Wed, 03 Oct 2007 15:50:54 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id l93Jos4L004250 for ; Wed, 3 Oct 2007 15:50:54 -0400 Received: from file.surrey.redhat.com (file.fab.redhat.com [10.33.63.6]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l93Jorq1001818 for ; Wed, 3 Oct 2007 15:50:53 -0400 Received: (from berrange@localhost) by file.surrey.redhat.com (8.13.1/8.13.1/Submit) id l93JorHM015522 for qemu-devel@nongnu.org; Wed, 3 Oct 2007 20:50:53 +0100 Date: Wed, 3 Oct 2007 20:50:53 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [Patch] VNC: Fix crash with non-resizing clients Message-ID: <20071003195052.GF8342@redhat.com> References: <83a4d4ca0710031229u68202e6aub32ba6257dfb0bc0@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83a4d4ca0710031229u68202e6aub32ba6257dfb0bc0@mail.gmail.com> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Oct 03, 2007 at 09:29:59PM +0200, Eduardo Felipe wrote: > Hi, > > 2007/9/25, GUERRAZ Francois : > > > > > > About your VNC problems : I have had problems w/ vnc too (see > > http://qemu-forum.ipi.fi/viewtopic.php?p=10468) but had no answer as > > well... > > > This problem happens when the VNC client doesn't support the DesktopSize > pseudo-encoding. Qemu crashes when the guest resizes down its display and > the VNC client sends a SetPixelFormat afterwards. > > Attached patch should fix this. It also forces a full buffer update after > resize. The memset calls in that patch are bogus & not correctly fixing the buffer update problem. You're merely setting the 'old data' to have pixel value 42 - if the guest OS framebuffer happens to also have aras with pixel value of 42 too, the frame buffer will still not correctly update. The root problem is overly-aggressive update minimization logic in vnc_update_client. This is in turn flawed beause the dirty_row aray is trying to encode two separate concepts - areas which are dirty, and areas which need to be sent to the client. The latter are a superset of the former, but the code in vnc_update_client minimizes based on dirtiness, so updates will get missed out. Setting the old data to 42 merely changes which areas will get missed updates. The QEMU code in Xen has added a update_row field, separate from the dirty_row field. Thus after a resize it can update the entire framebuffer, regardless of whether QEMU's copy of the framebuffer is dirty wrt to the guest copy. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|