qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix the monitor 'screendump' command
@ 2008-07-10 13:04 Avi Kivity
  2008-07-10 13:04 ` [Qemu-devel] [PATCH 1/2] fix vga screendump Avi Kivity
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Avi Kivity @ 2008-07-10 13:04 UTC (permalink / raw)
  To: qemu-devel

The screendump command was recently broken in qemu-svn.  Since many
test suites depend on the command, it's important to get it fixed.

The following two patches do just that.

 console.c |    5 +++++
 hw/vga.c  |    7 +++----
 2 files changed, 8 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/2] fix vga screendump
  2008-07-10 13:04 [Qemu-devel] [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
@ 2008-07-10 13:04 ` Avi Kivity
  2008-07-10 13:04 ` [Qemu-devel] [PATCH 2/2] fix screendump with multiple consoles Avi Kivity
  2008-07-10 13:20 ` [Qemu-devel] Re: [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-07-10 13:04 UTC (permalink / raw)
  To: qemu-devel

Commit 4812 ("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 <avi@qumranet.com>
---
 hw/vga.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index 5a3203c..0e3ccf3 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2281,11 +2281,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;
@@ -2293,7 +2293,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);
 
@@ -2302,5 +2301,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;
 }
-- 
1.5.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] fix screendump with multiple consoles
  2008-07-10 13:04 [Qemu-devel] [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
  2008-07-10 13:04 ` [Qemu-devel] [PATCH 1/2] fix vga screendump Avi Kivity
@ 2008-07-10 13:04 ` Avi Kivity
  2008-07-10 13:20 ` [Qemu-devel] Re: [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-07-10 13:04 UTC (permalink / raw)
  To: qemu-devel

pretend to be the active console while a screendump takes place.

Signed-off-by: Avi Kivity <avi@qumranet.com>
---
 console.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/qemu/console.c b/qemu/console.c
index a1bc769..061135f 100644
--- a/console.c
+++ b/console.c
@@ -167,10 +167,15 @@ void vga_hw_invalidate(void)
 
 void vga_hw_screen_dump(const char *filename)
 {
+    TextConsole *previous_active_console;
+
+    previous_active_console = active_console;
+    active_console = consoles[0];
     /* There is currently no was of specifying which screen we want to dump,
        so always dump the dirst one.  */
     if (consoles[0]->hw_screen_dump)
         consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
+    active_console = previous_active_console;
 }
 
 void vga_hw_text_update(console_ch_t *chardata)
-- 
1.5.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCH 0/2] Fix the monitor 'screendump' command
  2008-07-10 13:04 [Qemu-devel] [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
  2008-07-10 13:04 ` [Qemu-devel] [PATCH 1/2] fix vga screendump Avi Kivity
  2008-07-10 13:04 ` [Qemu-devel] [PATCH 2/2] fix screendump with multiple consoles Avi Kivity
@ 2008-07-10 13:20 ` Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-07-10 13:20 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Avi Kivity wrote:
> The screendump command was recently broken in qemu-svn.  Since many
> test suites depend on the command, it's important to get it fixed.
>
> The following two patches do just that.
>   

Another patch is needed (attached).


-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: force-resize.patch --]
[-- Type: text/plain, Size: 546 bytes --]

diff --git a/console.c b/console.c
index 061135f..055a3f1 100644
--- a/console.c
+++ b/console.c
@@ -1334,7 +1334,8 @@ CharDriverState *text_console_init(DisplayState *ds, const char *p)
 
 void qemu_console_resize(QEMUConsole *console, int width, int height)
 {
-    if (console->g_width != width || console->g_height != height) {
+    if (console->g_width != width || console->g_height != height
+        || !console->ds->data) {
         console->g_width = width;
         console->g_height = height;
         if (active_console == console) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-10 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 13:04 [Qemu-devel] [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity
2008-07-10 13:04 ` [Qemu-devel] [PATCH 1/2] fix vga screendump Avi Kivity
2008-07-10 13:04 ` [Qemu-devel] [PATCH 2/2] fix screendump with multiple consoles Avi Kivity
2008-07-10 13:20 ` [Qemu-devel] Re: [PATCH 0/2] Fix the monitor 'screendump' command Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).