* [Qemu-devel] [PATCH] Add chardev option to disable signal.
@ 2009-10-16 13:31 Kusanagi Kouichi
2009-10-16 14:04 ` Anthony Liguori
0 siblings, 1 reply; 3+ messages in thread
From: Kusanagi Kouichi @ 2009-10-16 13:31 UTC (permalink / raw)
To: qemu-devel
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 <slash@ac.auone-net.jp>
---
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 */ }
},
--
1.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Add chardev option to disable signal.
2009-10-16 13:31 [Qemu-devel] [PATCH] Add chardev option to disable signal Kusanagi Kouichi
@ 2009-10-16 14:04 ` Anthony Liguori
2009-10-17 10:59 ` Kusanagi Kouichi
0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2009-10-16 14:04 UTC (permalink / raw)
To: Kusanagi Kouichi; +Cc: qemu-devel
Kusanagi Kouichi wrote:
> 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 <slash@ac.auone-net.jp>
> ---
> 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;
>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Add chardev option to disable signal.
2009-10-16 14:04 ` Anthony Liguori
@ 2009-10-17 10:59 ` Kusanagi Kouichi
0 siblings, 0 replies; 3+ messages in thread
From: Kusanagi Kouichi @ 2009-10-17 10:59 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
On 2009-10-16 09:04:51 -0500, Anthony Liguori wrote:
> Kusanagi Kouichi wrote:
> >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 <slash@ac.auone-net.jp>
> >---
> > 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;
>
> 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?
That sounds good.
> Regards,
>
> Anthony Liguori
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-17 11:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 13:31 [Qemu-devel] [PATCH] Add chardev option to disable signal Kusanagi Kouichi
2009-10-16 14:04 ` Anthony Liguori
2009-10-17 10:59 ` Kusanagi Kouichi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.