From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R772I-0003UM-4V for qemu-devel@nongnu.org; Fri, 23 Sep 2011 10:47:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R772H-0003SW-3U for qemu-devel@nongnu.org; Fri, 23 Sep 2011 10:47:30 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:47485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R772G-0003SR-Vr for qemu-devel@nongnu.org; Fri, 23 Sep 2011 10:47:29 -0400 Received: from /spool/local by us.ibm.com with XMail ESMTP for from ; Fri, 23 Sep 2011 10:45:14 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8NEi4M4117714 for ; Fri, 23 Sep 2011 10:44:05 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8NEi4e7029979 for ; Fri, 23 Sep 2011 10:44:04 -0400 Message-ID: <4E7C9B33.3080002@us.ibm.com> Date: Fri, 23 Sep 2011 09:44:03 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E7280A7.5080809@web.de> In-Reply-To: <4E7280A7.5080809@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] console: Properly switch consoles for screen dumps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel , Andriy Gapon On 09/15/2011 05:48 PM, Jan Kiszka wrote: > From: Jan Kiszka > > 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 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++; > } > >