]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vga: Fix text mode screendumps
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 15 Sep 2011 22:47:55 +0000 (00:47 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 16 Sep 2011 13:25:57 +0000 (08:25 -0500)
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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/vga.c

index 125fb293f23f21787a3ba1657706f3412936734c..7be51419efe955bd737b6fe597073c1d3b886dc3 100644 (file)
--- 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)
@@ -2318,7 +2318,6 @@ static void vga_save_dpy_update(DisplayState *ds,
 {
     if (screen_dump_filename) {
         ppm_save(screen_dump_filename, ds->surface);
-        screen_dump_filename = NULL;
     }
 }
 
@@ -2396,8 +2395,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;
 }
-