re-fix screendump
PATCH 1/1 re-fix screendump
Removing the assumption about a single graphic console made get_graphic_console return NULL when called by vga_screen_dump. In this case returning NULL is correct but since NULL is not handled in qemu_console_resize it causes a segmentation fault.
Just returning immediately from qemu_console_resize is sufficient to fix the problem.
Signed-off-by Stefano Stabellini <[email protected]>
---
console.c +2 -0
@@ -1421,6 +1421,8 @@ void text_consoles_set_display(DisplayState *ds)void qemu_console_resize (DisplayState *ds,int width,int height) {TextConsole *s =get_graphic_console (ds); +if (!s)return ; + s->g_width = width; s->g_height = height;if (is_graphic_console ()) {
Anthony Liguori
AppliedQuoted 9 lines · Stefano Stabellini
Removing the assumption about a single graphic console made
get_graphic_consolereturn NULL when called byvga_screen_dump. In this case returning NULL is correct but since NULL is not handled inqemu_console_resizeit causes a segmentation fault.
Just returning immediately fromqemu_console_resizeis sufficient to fix the problem.Signed-off-by Stefano Stabellini <[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 21 lines
---
console.c +2
-0@@ -1421,6 +1421,8 @@ void text_consoles_set_display(DisplayState *ds)void qemu_console_resize (DisplayState *ds,int width,int height) {TextConsole *s =get_graphic_console (ds); +if (!s)return ; + s->g_width = width; s->g_height = height;if (is_graphic_console ()) {