From 995ee2bf469de6bbe5ce133ec853392b2a4ce34c Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Sat, 15 Sep 2012 01:15:41 +0900 Subject: curses: don't initialize curses when qemu is daemonized Current qemu initializes curses even if -daemonize option is passed. This cause problem because shell prompt appears without calling endwin(). This patch adds new function, is_daemonized(), to OS dependent code. With this function, curses_display_init() can check that qemu is daemonized or not. If daemonized, curses_display_init() isn't called and the problem is avoided. Of course, -daemonize && -curses doesn't make sense. Users shouldn't pass the arguments at the same time. But the problem is very painful because Ctrl-C cannot be delivered to the terminal. Cc: Andrzej Zaborowski Cc: Stefan Hajnoczi Cc: Anthony Liguori Cc: Michael Roth Signed-off-by: Hitoshi Mitake Signed-off-by: Stefan Hajnoczi --- os-posix.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'os-posix.c') diff --git a/os-posix.c b/os-posix.c index 79fa2288e4..eabccb8fe0 100644 --- a/os-posix.c +++ b/os-posix.c @@ -360,3 +360,8 @@ int qemu_create_pidfile(const char *filename) /* keep pidfile open & locked forever */ return 0; } + +bool is_daemonized(void) +{ + return daemonize; +} -- cgit v1.2.1