* [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps
@ 2011-09-15 22:48 Jan Kiszka
2011-09-16 15:13 ` Andriy Gapon
2011-09-23 14:44 ` Anthony Liguori
0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2011-09-15 22:48 UTC (permalink / raw)
To: Anthony Liguori, qemu-devel; +Cc: Andriy Gapon
From: Jan Kiszka <jan.kiszka@siemens.com>
Do not mess with active_console, use console_select instead. This fixes
corrupt virtual monitor consoles after issuing the screendump command.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Looks still weird - we should enable dumping to an invisible display
buffer - but it cures this symptom without rewriting the whole console
code.
console.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/console.c b/console.c
index 5c7a93b..6dfcc47 100644
--- a/console.c
+++ b/console.c
@@ -115,6 +115,7 @@ typedef enum {
/* ??? This is mis-named.
It is used for both text and graphical consoles. */
struct TextConsole {
+ int index;
console_type_t console_type;
DisplayState *ds;
/* Graphic console state. */
@@ -177,12 +178,15 @@ 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 way of specifying which screen we want to dump,
so always dump the first one. */
- if (consoles[0] && consoles[0]->hw_screen_dump)
+ console_select(0);
+ if (consoles[0] && consoles[0]->hw_screen_dump) {
consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
- active_console = previous_active_console;
+ }
+
+ console_select(previous_active_console->index);
}
void vga_hw_text_update(console_ch_t *chardata)
@@ -1247,6 +1251,7 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
s->ds = ds;
s->console_type = console_type;
if (console_type != GRAPHIC_CONSOLE) {
+ s->index = nb_consoles;
consoles[nb_consoles++] = s;
} else {
/* HACK: Put graphical consoles before text consoles. */
@@ -1254,7 +1259,9 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
if (consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
break;
consoles[i] = consoles[i - 1];
+ consoles[i]->index = i;
}
+ s->index = i;
consoles[i] = s;
nb_consoles++;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps
2011-09-15 22:48 [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps Jan Kiszka
@ 2011-09-16 15:13 ` Andriy Gapon
2011-09-23 14:44 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Andriy Gapon @ 2011-09-16 15:13 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Anthony Liguori, qemu-devel
on 16/09/2011 01:48 Jan Kiszka said the following:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Do not mess with active_console, use console_select instead. This fixes
> corrupt virtual monitor consoles after issuing the screendump command.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Looks still weird - we should enable dumping to an invisible display
> buffer - but it cures this symptom without rewriting the whole console
> code.
Yeah, there is a momentary flicker during the dump.
But I happy that the monitor console is not garbled now.
Thank you!
> console.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/console.c b/console.c
> index 5c7a93b..6dfcc47 100644
> --- a/console.c
> +++ b/console.c
> @@ -115,6 +115,7 @@ typedef enum {
> /* ??? This is mis-named.
> It is used for both text and graphical consoles. */
> struct TextConsole {
> + int index;
> console_type_t console_type;
> DisplayState *ds;
> /* Graphic console state. */
> @@ -177,12 +178,15 @@ 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 way of specifying which screen we want to dump,
> so always dump the first one. */
> - if (consoles[0] && consoles[0]->hw_screen_dump)
> + console_select(0);
> + if (consoles[0] && consoles[0]->hw_screen_dump) {
> consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
> - active_console = previous_active_console;
> + }
> +
> + console_select(previous_active_console->index);
> }
>
> void vga_hw_text_update(console_ch_t *chardata)
> @@ -1247,6 +1251,7 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
> s->ds = ds;
> s->console_type = console_type;
> if (console_type != GRAPHIC_CONSOLE) {
> + s->index = nb_consoles;
> consoles[nb_consoles++] = s;
> } else {
> /* HACK: Put graphical consoles before text consoles. */
> @@ -1254,7 +1259,9 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
> if (consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
> break;
> consoles[i] = consoles[i - 1];
> + consoles[i]->index = i;
> }
> + s->index = i;
> consoles[i] = s;
> nb_consoles++;
> }
--
Andriy Gapon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps
2011-09-15 22:48 [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps Jan Kiszka
2011-09-16 15:13 ` Andriy Gapon
@ 2011-09-23 14:44 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-09-23 14:44 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel, Andriy Gapon
On 09/15/2011 05:48 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Do not mess with active_console, use console_select instead. This fixes
> corrupt virtual monitor consoles after issuing the screendump command.
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
>
> Looks still weird - we should enable dumping to an invisible display
> buffer - but it cures this symptom without rewriting the whole console
> code.
>
> console.c | 13 ++++++++++---
> 1 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/console.c b/console.c
> index 5c7a93b..6dfcc47 100644
> --- a/console.c
> +++ b/console.c
> @@ -115,6 +115,7 @@ typedef enum {
> /* ??? This is mis-named.
> It is used for both text and graphical consoles. */
> struct TextConsole {
> + int index;
> console_type_t console_type;
> DisplayState *ds;
> /* Graphic console state. */
> @@ -177,12 +178,15 @@ 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 way of specifying which screen we want to dump,
> so always dump the first one. */
> - if (consoles[0]&& consoles[0]->hw_screen_dump)
> + console_select(0);
> + if (consoles[0]&& consoles[0]->hw_screen_dump) {
> consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
> - active_console = previous_active_console;
> + }
> +
> + console_select(previous_active_console->index);
> }
>
> void vga_hw_text_update(console_ch_t *chardata)
> @@ -1247,6 +1251,7 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
> s->ds = ds;
> s->console_type = console_type;
> if (console_type != GRAPHIC_CONSOLE) {
> + s->index = nb_consoles;
> consoles[nb_consoles++] = s;
> } else {
> /* HACK: Put graphical consoles before text consoles. */
> @@ -1254,7 +1259,9 @@ static TextConsole *new_console(DisplayState *ds, console_type_t console_type)
> if (consoles[i - 1]->console_type == GRAPHIC_CONSOLE)
> break;
> consoles[i] = consoles[i - 1];
> + consoles[i]->index = i;
> }
> + s->index = i;
> consoles[i] = s;
> nb_consoles++;
> }
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-09-23 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15 22:48 [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps Jan Kiszka
2011-09-16 15:13 ` Andriy Gapon
2011-09-23 14:44 ` Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.