From patchwork Fri Oct 16 13:31:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kusanagi Kouichi X-Patchwork-Id: 36209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D4E4B7BCD for ; Sat, 17 Oct 2009 00:33:18 +1100 (EST) Received: from localhost ([127.0.0.1]:59678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mymvi-00069v-A9 for incoming@patchwork.ozlabs.org; Fri, 16 Oct 2009 09:33:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MymuW-00068J-2c for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:32:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MymuR-00064m-CN for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:31:59 -0400 Received: from [199.232.76.173] (port=42452 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MymuQ-00064V-C9 for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:31:54 -0400 Received: from msa104.auone-net.jp ([61.117.18.164]:46488) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MymuP-00062b-Us for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:31:54 -0400 Received: from ppp.dion.ne.jp (ZR168251.ppp.dion.ne.jp [222.14.168.251]) by msa104.auone-net.jp (au one net msa) with ESMTP id 9D5E715C033 for ; Fri, 16 Oct 2009 22:31:39 +0900 (JST) Date: Fri, 16 Oct 2009 22:31:38 +0900 From: Kusanagi Kouichi To: qemu-devel@nongnu.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Message-Id: <20091016133139.9D5E715C033@msa104.auone-net.jp> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [Qemu-devel] [PATCH] Add chardev option to disable signal. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If I am using vga and serial which is stdio and hit C-c on serial console, qemu terminates. That is annoying for me. So make it configurable whether signal is generated when C-c is hit. Signed-off-by: Kusanagi Kouichi --- qemu-char.c | 6 +++--- qemu-config.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 8084a67..dd23e63 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -727,7 +727,7 @@ static void term_exit(void) fcntl(0, F_SETFL, old_fd0_flags); } -static void term_init(void) +static void term_init(QemuOpts *opts) { struct termios tty; @@ -740,7 +740,7 @@ static void term_init(void) tty.c_oflag |= OPOST; tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN); /* if graphical mode, we allow Ctrl-C handling */ - if (display_type == DT_NOGRAPHIC) + if (!qemu_opt_get_bool(opts, "signal", display_type != DT_NOGRAPHIC)) tty.c_lflag &= ~ISIG; tty.c_cflag &= ~(CSIZE|PARENB); tty.c_cflag |= CS8; @@ -773,7 +773,7 @@ static CharDriverState *qemu_chr_open_stdio(QemuOpts *opts) chr->chr_close = qemu_chr_close_stdio; qemu_set_fd_handler2(0, stdio_read_poll, stdio_read, NULL, chr); stdio_nb_clients++; - term_init(); + term_init(opts); return chr; } diff --git a/qemu-config.c b/qemu-config.c index cae92f7..fc73bea 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -134,6 +134,9 @@ QemuOptsList qemu_chardev_opts = { },{ .name = "mux", .type = QEMU_OPT_BOOL, + },{ + .name = "signal", + .type = QEMU_OPT_BOOL, }, { /* end if list */ } },