Patchwork [v2,1/2] trap signals for "-serial mon:stdio"

login
register
mail settings
Submitter Michael Tokarev
Date July 3, 2013, 8:09 a.m.
Message ID <51D3DC57.7070205@msgid.tls.msk.ru>
Download mbox | patch
Permalink /patch/256549/
State New
Headers show

Comments

Michael Tokarev - July 3, 2013, 8:09 a.m.
03.07.2013 11:13, Paolo Bonzini wrote:
...
>> --- a/qemu-options.hx
>> +++ b/qemu-options.hx
>> @@ -842,7 +842,8 @@ STEXI
>>  Normally, QEMU uses SDL to display the VGA output. With this option,
>>  you can totally disable graphical output so that QEMU is a simple
>>  command line application. The emulated serial port is redirected on
>> -the console. Therefore, you can still use QEMU to debug a Linux kernel
>> +the console and muxed with the monitor (unless redirected elsewhere
>> +explicitly).
> 
> By default, the emulated serial port and the monitor are multiplexed on
> the console; @option{-serial} and @option{-monitor} can be used to
> change this default.
> 
>  Therefore, you can still use QEMU to debug a Linux kernel
>>  with a serial console.
>>  ETEXI
>>  
>> @@ -2485,14 +2486,15 @@ same as if you had specified @code{-serial tcp} except the unix domain socket
>>  @item mon:@var{dev_string}
>>  This is a special option to allow the monitor to be multiplexed onto
>>  another serial port.  The monitor is accessed with key sequence of
>> -@key{Control-a} and then pressing @key{c}. See monitor access
>> -@ref{pcsys_keys} in the -nographic section for more keys.
>> +@key{Control-a} and then pressing @key{c}.
>>  @var{dev_string} should be any one of the serial devices specified
>>  above.  An example to multiplex the monitor onto a telnet server
>>  listening on port 4444 would be:
>>  @table @code
>>  @item -serial mon:telnet::4444,server,nowait
>>  @end table
>> +When monitor is multiplexed to stdio this way, Ctrl+C will not terminate
>> +guest anymore but will be passed to the guest as is.
> 
> will not terminate QEMU anymore...
>>  
>>  @item braille
>>  Braille device.  This will use BrlAPI to display the braille output on a real
>>
> 
> Also, there is another reference to -nographic here:
> 
> @item -echr @var{numeric_ascii_value}
> @findex -echr
> Change the escape character used for switching to the monitor when using
> monitor and serial sharing.  The default is @code{0x01} when using the
> @code{-nographic} option.  @code{0x01} is equal to pressing
> @code{Control-a}.  You can select a different character from the ascii
> control keys where 1 through 26 map to Control-a through Control-z.  For
> instance you could use the either of the following to change the escape
> character to Control-t.
> 
> You could remove "when using the @code{-nographic} option" from this
> paragraph.


Ok.  Thank you for the review.  English isn't my native language so extra
eyes on my wording is always apprecated.  Here's a new diff just for the
documentation part, based on your suggestions.  I changed the wording
a bit further, to make it all fit better with the surrounding text.

I'll resend a v3 with this change.  The first 1/2 patch (trap signals)
and the actual code did not change.

/mjt
Michael Tokarev - July 3, 2013, 8:13 a.m.
03.07.2013 12:09, Michael Tokarev wrote:
...
> I'll resend a v3 with this change.  The first 1/2 patch (trap signals)
> and the actual code did not change.
...
> @@ -2494,7 +2503,7 @@ listening on port 4444 would be:
>  @item -serial mon:telnet::4444,server,nowait
>  @end table
>  When monitor is multiplexed to stdio this way, Ctrl+C will not terminate
> -guest anymore but will be passed to the guest as is.
> +QEMU anymore but will be passed to the guest instead.

This should go to the 1/2 patch ofcourse.. ;)

/mjt
Paolo Bonzini - July 3, 2013, 8:21 a.m.
Just a couple more suggestions.

> /mjt
> 
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -825,7 +825,11 @@ a text mode. Generally only the VGA device models support text mode.
>  @item none
>  Do not display video output. The guest will still see an emulated
>  graphics card, but its output will not be displayed to the QEMU
> -user. This option differs from the -nographic option in that it
> +user.  The fact that we have no display is passed to firmware and
> +affects a few other places depending on the target architecture,
> +like switching console output to serial console or disabling keyboard
> +input.

Add an empty line here.

> +This option differs from the -nographic option in that it
>  only affects what is done with video output; -nographic also changes
>  the destination of the serial and parallel port data.
>  @item vnc
> @@ -841,10 +845,15 @@ STEXI
>  @findex -nographic
>  Normally, QEMU uses SDL to display the VGA output. With this option,
>  you can totally disable graphical output so that QEMU is a simple
> -command line application. The emulated serial port is redirected on
> -the console and muxed with the monitor (unless redirected elsewhere
> -explicitly). Therefore, you can still use QEMU to debug a Linux kernel
> -with a serial console.
> +command line application.  When this option is specified, unless
> +redirected explicitly, the emulated serial port and the monitor
> +are multiplexed on the console (stdio).

When this option is specified, the emulated serial port and the monitor
are by default multiplexed on the console (stdio).

> +This option is equivalent for

equivalent to

> +@example
> +-display none -serial mon:stdio -parallel none
> +@end example
> +Since even with no display, emulated serial port is still available,
> +you can use QEMU to debug a Linux kernel with a serial console.

I would just remove these two lines.

Paolo

Patch

--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -825,7 +825,11 @@  a text mode. Generally only the VGA device models support text mode.
 @item none
 Do not display video output. The guest will still see an emulated
 graphics card, but its output will not be displayed to the QEMU
-user. This option differs from the -nographic option in that it
+user.  The fact that we have no display is passed to firmware and
+affects a few other places depending on the target architecture,
+like switching console output to serial console or disabling keyboard
+input.
+This option differs from the -nographic option in that it
 only affects what is done with video output; -nographic also changes
 the destination of the serial and parallel port data.
 @item vnc
@@ -841,10 +845,15 @@  STEXI
 @findex -nographic
 Normally, QEMU uses SDL to display the VGA output. With this option,
 you can totally disable graphical output so that QEMU is a simple
-command line application. The emulated serial port is redirected on
-the console and muxed with the monitor (unless redirected elsewhere
-explicitly). Therefore, you can still use QEMU to debug a Linux kernel
-with a serial console.
+command line application.  When this option is specified, unless
+redirected explicitly, the emulated serial port and the monitor
+are multiplexed on the console (stdio).
+This option is equivalent for
+@example
+-display none -serial mon:stdio -parallel none
+@end example
+Since even with no display, emulated serial port is still available,
+you can use QEMU to debug a Linux kernel with a serial console.
 ETEXI

 DEF("curses", 0, QEMU_OPTION_curses,
@@ -2494,7 +2503,7 @@  listening on port 4444 would be:
 @item -serial mon:telnet::4444,server,nowait
 @end table
 When monitor is multiplexed to stdio this way, Ctrl+C will not terminate
-guest anymore but will be passed to the guest as is.
+QEMU anymore but will be passed to the guest instead.

 @item braille
 Braille device.  This will use BrlAPI to display the braille output on a real
@@ -2867,12 +2876,11 @@  STEXI
 @item -echr @var{numeric_ascii_value}
 @findex -echr
 Change the escape character used for switching to the monitor when using
-monitor and serial sharing.  The default is @code{0x01} when using the
-@code{-nographic} option.  @code{0x01} is equal to pressing
-@code{Control-a}.  You can select a different character from the ascii
-control keys where 1 through 26 map to Control-a through Control-z.  For
-instance you could use the either of the following to change the escape
-character to Control-t.
+monitor and serial sharing.  The default is @code{0x01}, which is equivalent
+to pressing @code{Control-a}.
+You can select a different character from the ascii control keys where
+1 through 26 map to Control-a through Control-z.  For instance you could
+use the either of the following to change the escape character to Control-t.
 @table @code
 @item -echr 0x14
 @item -echr 20