From 2313e998d7bf55d02499ee162fb4558af4fbb3f5 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 16 Sep 2011 00:47:55 +0200 Subject: [PATCH] vga: Fix text mode screendumps 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 Signed-off-by: Anthony Liguori --- hw/vga.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 125fb293f2..7be51419ef 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) @@ -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; } - -- 2.11.4.GIT