Add chardev option to disable signal.
PATCH 1/1 Add chardev option to disable signal.
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.
--- qemu-char.c | 6 +++--- qemu-config.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-)
qemu-char.c +3 -3
@@ -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; }
qemu-config.c +3 -0
@@ -134,6 +134,9 @@ QemuOptsList qemu_chardev_opts = { },{ .name = "mux", .type = QEMU_OPT_BOOL, + },{ + .name = "signal", + .type = QEMU_OPT_BOOL, }, {/* end if list */ } },
Signature · 1 line
1.6.5
Quoted 24 lines · Kusanagi Kouichi
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 <[email protected]>--- qemu-char.c | 6 +++--- qemu-config.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-)qemu-char.c +1
-1@@ -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;
qemu-char.c static void term_init(void) · line 745
Quoted 7 lines
qemu-char.c +1
-1@@ -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 ;
Would be nice to eliminate the DT_NOGRAPHIC check here. In fact, looking at the other nographic check, they look bogus.
So how about eliminating DT_NOGRAPHIC entirely and replacing it with DT_NONE + appropriate serial config?
Regards,
Anthony Liguori
Quoted 33 lines · Anthony Liguori
Quoted 22 lines · Kusanagi Kouichi
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 <[email protected]>---
qemu-char.c | 6 +++--- qemu-config.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-)qemu-char.c +1
-1@@ -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;qemu-char.c static void term_init(void) · line 744
Quoted 6 lines
qemu-char.c +1
-1@@ -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 ;Would be nice to eliminate the
DT_NOGRAPHICcheck here. In fact, looking at the other nographic check, they look bogus.
Quoted 2 lines
So how about eliminating
DT_NOGRAPHICentirely and replacing it withDT_NONE+ appropriate serial config?
That sounds good.
Quoted 3 lines
Regards,
Anthony Liguori