From patchwork Tue Apr 7 09:33:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 16778 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n379YlAW009415 for ; Tue, 7 Apr 2009 09:34:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbZDGJe2 (ORCPT ); Tue, 7 Apr 2009 05:34:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750979AbZDGJe2 (ORCPT ); Tue, 7 Apr 2009 05:34:28 -0400 Received: from mx2.redhat.com ([66.187.237.31]:58643 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbZDGJe1 (ORCPT ); Tue, 7 Apr 2009 05:34:27 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n379YN0U013336; Tue, 7 Apr 2009 05:34:23 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n379YOU5011211; Tue, 7 Apr 2009 05:34:24 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n379YMLY016413; Tue, 7 Apr 2009 05:34:23 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 422F825004B; Tue, 7 Apr 2009 12:33:53 +0300 (IDT) From: Avi Kivity To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH] Fix crash on resolution change -> screen dump -> vga redraw Date: Tue, 7 Apr 2009 12:33:52 +0300 Message-Id: <1239096832-25757-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The vga screen dump function updates last_width and last_height, but does not change the DisplaySurface that these variables describe. A consequent vga_draw_graphic() will therefore fail to resize the surface and crash. Fix by invalidating the display state after a screen dump, forcing vga_draw_graphic() to reallocate the DisplaySurface. Signed-off-by: Avi Kivity --- hw/vga.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index b1e4373..4d1049b 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -2678,4 +2678,5 @@ static void vga_screen_dump(void *opaque, const char *filename) vga_screen_dump_graphic(s, filename); else vga_screen_dump_text(s, filename); + vga_invalidate_display(s); }