From patchwork Thu Sep 15 22:47:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 114840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EDACEB70D6 for ; Fri, 16 Sep 2011 08:48:07 +1000 (EST) Received: from localhost ([::1]:38069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Kix-0001kV-Al for incoming@patchwork.ozlabs.org; Thu, 15 Sep 2011 18:48:03 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Kis-0001kQ-48 for qemu-devel@nongnu.org; Thu, 15 Sep 2011 18:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4Kir-0003mj-8V for qemu-devel@nongnu.org; Thu, 15 Sep 2011 18:47:58 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:33590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Kiq-0003mf-Tq for qemu-devel@nongnu.org; Thu, 15 Sep 2011 18:47:57 -0400 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate01.web.de (Postfix) with ESMTP id E45B8197039D8; Fri, 16 Sep 2011 00:47:55 +0200 (CEST) Received: from [88.64.18.193] (helo=mchn199C.mchp.siemens.de) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1R4Kip-0005yl-00; Fri, 16 Sep 2011 00:47:55 +0200 Message-ID: <4E72809B.8000209@web.de> Date: Fri, 16 Sep 2011 00:47:55 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Anthony Liguori , qemu-devel X-Enigmail-Version: 1.3.1 X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX18OjXT9AvlBMamcjCp2CiK9qBDy3Oup4OU6yS+m 1eBg3Y619s7cg0TREEId0O2gToMFIu8Usqo884p7jlJj2i8Xk4 fk42iyxNE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Cc: Andriy Gapon Subject: [Qemu-devel] [PATCH] vga: Fix text mode screendumps 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 From: Jan Kiszka In text mode, even a full refresh of the screen takes multiple updates. As we reset the dump file pointer after the first call, we only wrote the first line. Signed-off-by: Jan Kiszka --- hw/vga.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 0a0c5a6..f9a6014 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -149,7 +149,7 @@ static uint16_t expand2[256]; static uint8_t expand4to8[16]; static void vga_screen_dump(void *opaque, const char *filename); -static char *screen_dump_filename; +static const char *screen_dump_filename; static DisplayChangeListener *screen_dump_dcl; static void vga_update_memory_access(VGACommonState *s) @@ -2319,7 +2319,6 @@ static void vga_save_dpy_update(DisplayState *ds, { if (screen_dump_filename) { ppm_save(screen_dump_filename, ds->surface); - screen_dump_filename = NULL; } } @@ -2397,8 +2396,8 @@ static void vga_screen_dump(void *opaque, const char *filename) if (!screen_dump_dcl) screen_dump_dcl = vga_screen_dump_init(s->ds); - screen_dump_filename = (char *)filename; + screen_dump_filename = filename; vga_invalidate_display(s); vga_hw_update(); + screen_dump_filename = NULL; } -