[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: Bug/Inconvenience report
From: |
Mark Jonckheere |
Subject: |
[Qemu-devel] Re: Bug/Inconvenience report |
Date: |
Wed, 18 Aug 2004 12:21:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408 |
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