From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BxNdO-00026x-Nd for qemu-devel@nongnu.org; Wed, 18 Aug 2004 06:25:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BxNdM-00026l-Tm for qemu-devel@nongnu.org; Wed, 18 Aug 2004 06:25:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BxNdM-00026i-QQ for qemu-devel@nongnu.org; Wed, 18 Aug 2004 06:25:32 -0400 Received: from [195.238.3.51] (helo=outmx001.isp.belgacom.be) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BxNYt-0008DE-CE for qemu-devel@nongnu.org; Wed, 18 Aug 2004 06:20:55 -0400 Received: from outmx001.isp.belgacom.be (localhost [127.0.0.1]) by outmx001.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id i7IAKcKL003139 for ; Wed, 18 Aug 2004 12:20:38 +0200 (envelope-from ) Received: from easynet.be (142-158.241.81.adsl.skynet.be [81.241.158.142]) by outmx001.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id i7IAKV2o003072 for ; Wed, 18 Aug 2004 12:20:31 +0200 (envelope-from ) Message-ID: <41232DC5.7040205@easynet.be> Date: Wed, 18 Aug 2004 12:21:57 +0200 From: Mark Jonckheere MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Bug/Inconvenience report Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Johannes Martin wrote: > Hi, > > when qemu crashes, it usually leaves the console window in a state where > input isn't echoed to the terminal, i.e. you don't see what you type any > more. /usr/bin/reset fixes this. I propose a small patch to change the console tty settings only when qemu uses the console for input/output. ----------------------------------------------->8-- diff -wurb qemu/vl.c qemu-patched/vl.c --- qemu/vl.c Wed Aug 4 00:09:30 2004 +++ qemu-patched/vl.c Wed Aug 4 12:53:38 2004 @@ -1467,6 +1467,8 @@ static void term_exit(void) { + if (stdio_nb_clients == 0) + return; tcsetattr (0, TCSANOW, &oldtty); fcntl(0, F_SETFL, old_fd0_flags); } @@ -1475,6 +1477,8 @@ { struct termios tty; + if (stdio_nb_clients == 0) + return; tcgetattr (0, &tty); oldtty = tty; old_fd0_flags = fcntl(0, F_GETFL); ----------------------------------------------->8-- This patch enables qemu to run as a background process. It initialises the current terminal only when serial- or monitor-I/O is redirected to stdin/stdout or when -nographic is selected. Without this patch, the program hangs in the term_init() and term_exit() functions when running as a background process. examples: qemu -hda disk.img & xinit /usr/local/bin/qemu -hda disk.img -- :1 & The second example launches qemu with a second X server and permits to switch between host and guest operating systems using ctrl-alt-F7 and ctrl-alt-F8. > > Also, if qemu had grabbed the mouse before crashing, the mouse will be > stuck after the crash or disappear completely. Restarting qemu and > grabbing/degrabbing will fix this. Even worse is working in full-screen mode before a crash. > > Would it be possible to install some signal handlers and/or atexit() > routines to restore console and mouse settings on unexpected failures? and returning from full-screen mode. > > Thanks > Johannes Mark Jonckheere -- :wq