All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Patch Send Ctrl-C to stdio target.
Date: Tue, 12 Aug 2008 11:15:38 -0500	[thread overview]
Message-ID: <48A1B72A.4000109@codemonkey.ws> (raw)
In-Reply-To: <58BD0469C48A7443A479A13D101685E3CBFD68@ala-mail09.corp.ad.wrs.com>

Krumme, Chris wrote:
> Hello Anthony,
>
> You were quite right, the ckmakeraw function was the direction to go.
>
> It turns out that the utility of that function had already been hard
> coded in vl.c, with one twist.  The ISIG attribute was controlled by the
> -nographic option.
>
> In my use I had written a script that backdoored -nographic by setting
> the various outputs to use stdio instead of VGA, but I had not used the
> -nographic option. This meant I had all of the functionality of
> -nographic except the ISIG attribute (and a banner message :-).  This
> lead me to want to get rid of the SIGINT.
>
> So now I have to ask: what is the connection between ISIG for Control-C
> handling and using the monitor, serial port, or parallel port on stdio.
> If any one of these uses stdio then I think the ISIG should be used
> without regard to the -nographic option.
>   

That would be a bit of a pain.  When you use -nographic, you get monitor 
multiplexing which means that you can kill the qemu process by doing 
'C-a x'.  If we unconditionally set ISIG when -serial stdio then it's 
impossible to kill the QEMU process from the same tty which is a bit 
annoying.

In the very least, it needs to be a non default option for stdio.  
However, I should ask, why are you not just using -nographic?

Regards,

Anthony Liguori

> Thanks
>
> Chris
>
> Here is a patch to affect this change:
> Index: vl.c
> ===================================================================
> --- vl.c	(revision 4995)
> +++ vl.c	(working copy)
> @@ -2368,8 +2368,7 @@
>      tty.c_oflag |= OPOST;
>      tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
>      /* if graphical mode, we allow Ctrl-C handling */
> -    if (nographic)
> -        tty.c_lflag &= ~ISIG;
> +    tty.c_lflag &= ~ISIG;
>      tty.c_cflag &= ~(CSIZE|PARENB);
>      tty.c_cflag |= CS8;
>      tty.c_cc[VMIN] = 1;
>
>
>
>
> -----Original Message-----
> From: qemu-devel-bounces+chris.krumme=windriver.com@nongnu.org
> [mailto:qemu-devel-bounces+chris.krumme=windriver.com@nongnu.org] On
> Behalf Of Anthony Liguori
> Sent: Monday, August 11, 2008 4:14 PM
> To: qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] Patch Send Ctrl-C to stdio target.
>
> Krumme, Chris wrote:
>   
>> Hello,
>>  
>> This patch will catch a SIGINT and pass it as a ctrl-c to the target 
>> when running with the target on stdio.
>>   
>>     
>
> Just catching SIGINT is kind of a hack.  What about SIGSTOP and SIGCONT?
>
> If we're going to go this route, we should do it properly by cfmakeraw()
> stdio instead of trapping individual signals.
>
> Regards,
>
> Anthony Liguori
>
>
>
>
>
>   

  parent reply	other threads:[~2008-08-12 16:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 20:15 [Qemu-devel] Patch Send Ctrl-C to stdio target Krumme, Chris
2008-08-11 21:13 ` Anthony Liguori
2008-08-12 15:31   ` Krumme, Chris
2008-08-12 15:36     ` Samuel Thibault
2008-08-12 18:34       ` Krumme, Chris
2008-08-12 21:01         ` Samuel Thibault
2008-08-12 16:15     ` Anthony Liguori [this message]
2008-08-12 19:06       ` Krumme, Chris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A1B72A.4000109@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.