[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized |
Date: |
Sun, 23 Sep 2012 11:00:15 +0100 |
From: Hitoshi Mitake <address@hidden>
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 <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Cc: Anthony Liguori <address@hidden>
Cc: Michael Roth <address@hidden>
Signed-off-by: Hitoshi Mitake <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
os-posix.c | 5 +++++
qemu-os-posix.h | 2 ++
qemu-os-win32.h | 5 +++++
vl.c | 4 +++-
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/os-posix.c b/os-posix.c
index 79fa228..eabccb8 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;
+}
diff --git a/qemu-os-posix.h b/qemu-os-posix.h
index 8e1149d..7f198e4 100644
--- a/qemu-os-posix.h
+++ b/qemu-os-posix.h
@@ -46,4 +46,6 @@ typedef struct timeval qemu_timeval;
typedef struct timespec qemu_timespec;
int qemu_utimens(const char *path, const qemu_timespec *times);
+bool is_daemonized(void);
+
#endif
diff --git a/qemu-os-win32.h b/qemu-os-win32.h
index 753679b..b3e451b 100644
--- a/qemu-os-win32.h
+++ b/qemu-os-win32.h
@@ -86,4 +86,9 @@ typedef struct {
} qemu_timeval;
int qemu_gettimeofday(qemu_timeval *tp);
+static inline bool is_daemonized(void)
+{
+ return false;
+}
+
#endif
diff --git a/vl.c b/vl.c
index 7c577fa..48049ef 100644
--- a/vl.c
+++ b/vl.c
@@ -3657,7 +3657,9 @@ int main(int argc, char **argv, char **envp)
break;
#if defined(CONFIG_CURSES)
case DT_CURSES:
- curses_display_init(ds, full_screen);
+ if (!is_daemonized()) {
+ curses_display_init(ds, full_screen);
+ }
break;
#endif
#if defined(CONFIG_SDL)
--
1.7.10.4
- [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 01/14] target-i386: Allow tsc-frequency to be larger then 2.147G, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 03/14] qemu-sockets: Fix potential memory leak, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 02/14] qemu-ga: Remove unreachable code after g_error, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 04/14] cadence_uart: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 05/14] lm4549: Fix buffer overflow, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 07/14] pflash_cfi01: Fix warning caused by unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 06/14] ioh3420: Remove unreachable code, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 08/14] dtrace backend: add function to reserved words, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 09/14] curses: don't initialize curses when qemu is daemonized,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 10/14] TextConsole: saturate escape parameter in TTY_STATE_CSI, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 11/14] qemu-timer: simplify qemu_run_timers, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 13/14] net/socket: Fix compiler warning (regression for MinGW), Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 12/14] linux-user: Remove redundant null check and replace free by g_free, Stefan Hajnoczi, 2012/09/23
- [Qemu-devel] [PATCH 14/14] w32: Always use standard instead of native format strings, Stefan Hajnoczi, 2012/09/23
- Re: [Qemu-devel] [PULL 00/14] Trivial patches for 15 to 23 September 2012, Anthony Liguori, 2012/09/25