* [Qemu-devel] handling SIGWINCH with qemu -nographic
@ 2007-10-16 1:15 Jeff Carr
2007-10-16 2:32 ` Paul Brook
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Jeff Carr @ 2007-10-16 1:15 UTC (permalink / raw)
To: qemu-devel
Has anyone looked into finding a way to pass SIGWINCH through to the
guest? I started looking at linux-user/signal.c.
For those that might not be familiar with SIGWINCH, supporting it
would allow qemu -nographic to tell when the terminal is a different
size than 80x24.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 1:15 [Qemu-devel] handling SIGWINCH with qemu -nographic Jeff Carr
@ 2007-10-16 2:32 ` Paul Brook
2007-10-16 18:21 ` Jeff Carr
2007-10-16 14:04 ` Stuart Brady
2007-10-20 0:22 ` Rob Landley
2 siblings, 1 reply; 8+ messages in thread
From: Paul Brook @ 2007-10-16 2:32 UTC (permalink / raw)
To: qemu-devel
On Tuesday 16 October 2007, Jeff Carr wrote:
> Has anyone looked into finding a way to pass SIGWINCH through to the
> guest? I started looking at linux-user/signal.c.
>
> For those that might not be familiar with SIGWINCH, supporting it
> would allow qemu -nographic to tell when the terminal is a different
> size than 80x24.
qemu emulates a real machine. Signals are an operating system concept, so your
question makes no sense. Configure your guest OS exactly the same way you
would a real machine with a serial console.
The linux-user code is for the userspace emulation. You're obviously using the
full system emulation.
Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 1:15 [Qemu-devel] handling SIGWINCH with qemu -nographic Jeff Carr
2007-10-16 2:32 ` Paul Brook
@ 2007-10-16 14:04 ` Stuart Brady
2007-10-20 0:22 ` Rob Landley
2 siblings, 0 replies; 8+ messages in thread
From: Stuart Brady @ 2007-10-16 14:04 UTC (permalink / raw)
To: qemu-devel
On Mon, Oct 15, 2007 at 06:15:29PM -0700, Jeff Carr wrote:
> For those that might not be familiar with SIGWINCH, supporting it
> would allow qemu -nographic to tell when the terminal is a different
> size than 80x24.
That would need support on the remote side (the getty) as well as on the
terminal (minicom/tip/qemu -nographic/whatever).
While this would be a nice feature (and support for propagating the
TERM, LANG and LC_* variables might be nice, too), I'm doubtful as to
whether this will ever happen.
--
Stuart Brady
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 2:32 ` Paul Brook
@ 2007-10-16 18:21 ` Jeff Carr
2007-10-16 20:51 ` Stefan Weil
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Carr @ 2007-10-16 18:21 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel
On 10/15/07 19:32, Paul Brook wrote:
> qemu emulates a real machine. Signals are an operating system concept, so your
> question makes no sense. Configure your guest OS exactly the same way you
> would a real machine with a serial console.
OK. I thought there might be a way.
> The linux-user code is for the userspace emulation. You're obviously using the
> full system emulation.
It seemed that's where the handler would have to go. I don't know if
there is some way to pass that through a serial device. I wasn't sure
if it would require some custom qemu serial driver for the guest.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 18:21 ` Jeff Carr
@ 2007-10-16 20:51 ` Stefan Weil
2007-10-16 21:21 ` Paul Brook
2007-10-20 0:24 ` Rob Landley
0 siblings, 2 replies; 8+ messages in thread
From: Stefan Weil @ 2007-10-16 20:51 UTC (permalink / raw)
To: qemu-devel
Jeff Carr schrieb:
> On 10/15/07 19:32, Paul Brook wrote:
>
>> qemu emulates a real machine. Signals are an operating system
>> concept, so your
>> question makes no sense. Configure your guest OS exactly the same way
>> you
>> would a real machine with a serial console.
>
> OK. I thought there might be a way.
I think your question is quite reasonable. Imagine a Linux host
running X Windows and a terminal like xterm or kconsole.
Then run a program like "top" or "less" in this terminal.
When a user changes the size of the console window, top, less
and other console applications get notified of this change by SIGWINCH.
Now run a similar program using QEMU's user mode emulation.
Why should it not be possible to get SIGWINCH in QEMU and
pass it on to the program in user mode emulation, so it can
behave like a native Linux application and change its appearance?
I don't think that implementing this is very difficult, so it will be
done.
Regards
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 20:51 ` Stefan Weil
@ 2007-10-16 21:21 ` Paul Brook
2007-10-20 0:24 ` Rob Landley
1 sibling, 0 replies; 8+ messages in thread
From: Paul Brook @ 2007-10-16 21:21 UTC (permalink / raw)
To: qemu-devel
> I think your question is quite reasonable. Imagine a Linux host
> running X Windows and a terminal like xterm or kconsole.
> Then run a program like "top" or "less" in this terminal.
> When a user changes the size of the console window, top, less
> and other console applications get notified of this change by SIGWINCH.
>
> Now run a similar program using QEMU's user mode emulation.
> Why should it not be possible to get SIGWINCH in QEMU and
> pass it on to the program in user mode emulation, so it can
> behave like a native Linux application and change its appearance?
>
> I don't think that implementing this is very difficult, so it will be
> done.
Try doing the same thing with a real machine connected via a serial port.
It won't work.
The difference is that for local applications (and remote terminals via telnet
or ssh) you have OOB mechanisms to transmit event data (e.g. terminal size).
A UART only gives you a simple serial connection. If you want things like
terminal resizing to work you need to run some more complicated protocol over
the serial link, with appropriate tty emulation on either end.
Paul
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 1:15 [Qemu-devel] handling SIGWINCH with qemu -nographic Jeff Carr
2007-10-16 2:32 ` Paul Brook
2007-10-16 14:04 ` Stuart Brady
@ 2007-10-20 0:22 ` Rob Landley
2 siblings, 0 replies; 8+ messages in thread
From: Rob Landley @ 2007-10-20 0:22 UTC (permalink / raw)
To: qemu-devel
On Monday 15 October 2007 8:15:29 pm Jeff Carr wrote:
> Has anyone looked into finding a way to pass SIGWINCH through to the
> guest? I started looking at linux-user/signal.c.
>
> For those that might not be familiar with SIGWINCH, supporting it
> would allow qemu -nographic to tell when the terminal is a different
> size than 80x24.
The problem is a serial port is essentially a pipe. You don't get tty
information about the terminal plugged into the other side, because that's a
separate machine on the other side of a piece of hardware which doesn't pass
through that info. (What _is_ the width and height of a modem?)
Have your program send an ansi probe sequence:
echo -e "\e[s\e[999C\e[999B\e[6n\e[u"
Then parse the return string, which should look something like escape left
bracket 25 semicolon 80 capital R, and use it to set $LINES=25 and
$COLUMNS=80.
Any modern terminal program should handle that and spit back a result telling
you big the tty is (although it doesn't tell you when it _changes_, you have
to re-probe). Yes, it's in-band signalling but over a serial connection
that's all you've got.
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] handling SIGWINCH with qemu -nographic
2007-10-16 20:51 ` Stefan Weil
2007-10-16 21:21 ` Paul Brook
@ 2007-10-20 0:24 ` Rob Landley
1 sibling, 0 replies; 8+ messages in thread
From: Rob Landley @ 2007-10-20 0:24 UTC (permalink / raw)
To: qemu-devel
On Tuesday 16 October 2007 3:51:29 pm Stefan Weil wrote:
> Jeff Carr schrieb:
> > On 10/15/07 19:32, Paul Brook wrote:
> >> qemu emulates a real machine. Signals are an operating system
> >> concept, so your
> >> question makes no sense. Configure your guest OS exactly the same way
> >> you
> >> would a real machine with a serial console.
> >
> > OK. I thought there might be a way.
>
> I think your question is quite reasonable. Imagine a Linux host
> running X Windows and a terminal like xterm or kconsole.
This is why ssh was invented. That passes through terminal information just
fine. QEMU does have a virtual network...
> Then run a program like "top" or "less" in this terminal.
> When a user changes the size of the console window, top, less
> and other console applications get notified of this change by SIGWINCH.
You can also set the environment variables COLUMNS and LINES to the
appropriate values. Most things will parse that and use it if the tty info
isn't available.
Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-10-20 3:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-16 1:15 [Qemu-devel] handling SIGWINCH with qemu -nographic Jeff Carr
2007-10-16 2:32 ` Paul Brook
2007-10-16 18:21 ` Jeff Carr
2007-10-16 20:51 ` Stefan Weil
2007-10-16 21:21 ` Paul Brook
2007-10-20 0:24 ` Rob Landley
2007-10-16 14:04 ` Stuart Brady
2007-10-20 0:22 ` Rob Landley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).