qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Qemu-devel] Patch Send Ctrl-C to stdio target.


From: Krumme, Chris
Subject: RE: [Qemu-devel] Patch Send Ctrl-C to stdio target.
Date: Tue, 12 Aug 2008 12:06:09 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
rg] On Behalf Of Anthony Liguori
> Sent: Tuesday, August 12, 2008 11:16 AM
> To: address@hidden
> Subject: Re: [Qemu-devel] Patch Send Ctrl-C to stdio target.
> 
> 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?
> 

You refer to -nographic as causing the multiplexing, the multiplexing is
caused by the mon:stdio option. -nographic has this side effect.

Since I was working on writing a script that helped the user by having a
limited set of options and taking care of some things for the user such
as creating the tftpboot directory with the right files and setting up
some of the networking and redirection for them. I don't think I am in
the -nographic mode since I actually have a vnc option. (The vga does
not have a shell in my kernel, so it is just startup messages.) I may
start using -nographic or -curses, though the advantage of each are not
well documented.

So now for the issue of quitting Qemu. There are a few cases:
Multiplexing: ^a x works. Only -serial stdio: Monitor is still available
on vga, just not part of the stdio, 'quit' works. -monitor none: in this
case ^c is not available for killing qemu, only 'kill' would work.

I ask the question the other way around: since ^c is used for line
editing in many shells when would you ever not want to send the ^c to
the target?

I only want to kill qemu occasionally when using a stdio shell. I find
it very annoying to be typing a command, then decide to go another
direction and press ^c to find not just my line gone but my entire
system :-)

Obviously personal usage is a big part of this. You say you don't think
this is a good default, you think it would be better to add another
option? Or to add a stdio sub-options?

Thanks

Chris

> 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: address@hidden
> > 
> [mailto:address@hidden On 
> > Behalf Of Anthony Liguori
> > Sent: Monday, August 11, 2008 4:14 PM
> > To: address@hidden
> > 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
> >
> >
> >
> >
> >
> >   
> 
> 
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]