[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump |
Date: |
Thu, 17 Jul 2008 16:19:40 -0500 |
From: Avi Kivity <address@hidden>
Commit 737d2050 ("Implement resolution switching in common console code")
uses qemu_console_resize() instead of dpy_resize(). This means console->ds
is examined instead of the VGA private ds, and the resize does not take place,
leading to a segfault.
Fix by modifying the DisplayState directly rather than swapping the pointer.
Signed-off-by: Avi Kivity <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
diff --git a/hw/vga.c b/hw/vga.c
index a059e32..95d6033 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2516,11 +2516,11 @@ int ppm_save(const char *filename, uint8_t *data,
static void vga_screen_dump(void *opaque, const char *filename)
{
VGAState *s = (VGAState *)opaque;
- DisplayState *saved_ds, ds1, *ds = &ds1;
+ DisplayState saved_ds, *ds = s->ds;
/* XXX: this is a little hackish */
vga_invalidate_display(s);
- saved_ds = s->ds;
+ saved_ds = *s->ds;
memset(ds, 0, sizeof(DisplayState));
ds->dpy_update = vga_save_dpy_update;
@@ -2528,7 +2528,6 @@ static void vga_screen_dump(void *opaque, const char
*filename)
ds->dpy_refresh = vga_save_dpy_refresh;
ds->depth = 32;
- s->ds = ds;
s->graphic_mode = -1;
vga_update_display(s);
@@ -2537,5 +2536,5 @@ static void vga_screen_dump(void *opaque, const char
*filename)
s->ds->linesize);
qemu_free(ds->data);
}
- s->ds = saved_ds;
+ *s->ds = saved_ds;
}
- [Qemu-devel] [PATCH 1/6] kvm: qemu: fix screendump with multiple consoles, Anthony Liguori, 2008/07/17
- [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump,
Anthony Liguori <=
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, andrzej zaborowski, 2008/07/19
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Anthony Liguori, 2008/07/19
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, andrzej zaborowski, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Anthony Liguori, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, andrzej zaborowski, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Anthony Liguori, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, andrzej zaborowski, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Anthony Liguori, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Anthony Liguori, 2008/07/20
- Re: [Qemu-devel] [PATCH 6/6] kvm: qemu: fix vga screendump, Jamie Lokier, 2008/07/20