From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSwXk-00084g-PE for qemu-devel@nongnu.org; Tue, 12 Aug 2008 12:16:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSwXj-00081r-1J for qemu-devel@nongnu.org; Tue, 12 Aug 2008 12:16:20 -0400 Received: from [199.232.76.173] (port=50349 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSwXi-00081h-SB for qemu-devel@nongnu.org; Tue, 12 Aug 2008 12:16:18 -0400 Received: from mail-gx0-f23.google.com ([209.85.217.23]:40397) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSwXi-0008Q5-Gc for qemu-devel@nongnu.org; Tue, 12 Aug 2008 12:16:18 -0400 Received: by gxk4 with SMTP id 4so2201gxk.10 for ; Tue, 12 Aug 2008 09:16:17 -0700 (PDT) Message-ID: <48A1B72A.4000109@codemonkey.ws> Date: Tue, 12 Aug 2008 11:15:38 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Patch Send Ctrl-C to stdio target. References: <58BD0469C48A7443A479A13D101685E3CBFB0F@ala-mail09.corp.ad.wrs.com> <48A0AB95.3000009@codemonkey.ws> <58BD0469C48A7443A479A13D101685E3CBFD68@ala-mail09.corp.ad.wrs.com> In-Reply-To: <58BD0469C48A7443A479A13D101685E3CBFD68@ala-mail09.corp.ad.wrs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 > > > > > >