From: Michael Tokarev <mjt@tls.msk.ru>
To: KVM list <kvm@vger.kernel.org>
Cc: qemu-devel@nongnu.org
Subject: Re: serial port again
Date: Fri, 21 Aug 2009 18:34:39 +0400 [thread overview]
Message-ID: <4A8EB07F.10703@msgid.tls.msk.ru> (raw)
In-Reply-To: <4A8E6282.8030704@msgid.tls.msk.ru>
[Adding qemu-devel@ since kvm@ is not interested
and since serial port seems to be qemu thing]
Michael Tokarev wrote:
> Is it just me with this issue? Anyone who has serial port
> working for anything more than serial console (that is, with
> control chars etc, not only text) ?
I just ran a quick test. Telling pppd(8) to escape all
control characters on both ends (default-asyncmap option)
let the connection to run. So kvm/qemu interprets (some)
control characters or sequences somehow.
Anyone here who's able to tell something about the
8bit cleaness of the qemu serial ports?
Thanks!
> Michael Tokarev wrote at Sun, 26 Jul 2009 00:09:57 +0400:
>> Finally, I'm trying to use serial port in a kvm guest.
>> And as in my previous attempt, it does not quite work.
>>
>> qemu-kvm-0.10.5, 2.6.27.latest guest, 2.6.30.latest host.
>>
>> Running pppd over real serial/model lines for now. Dialing
>> into kvm virtual machine from another location, kvm pppd
>> acts as dial-in server. Authentication succeeded, 2 pppd
>> starts exchanging options. But at least one option never
>> reaches the dialing in machine from a ppp server.
>>
>> Here's some straces. I'm omitting client to server
>> communicatiins, leaving only server to client.
>>
>> server:
>> 23:18:43 send(3, "<31>Jul 25 23:18:43 pppd[3199]: sent [PAP AuthAck
>> id=0x1 \"\"]"..., 60, MSG_NOSIGNAL) = 60
>> 23:18:43 write(7, "\300#\2\1\0\5\0"..., 7) = 7
>>
>> client:
>> 23:18:44 read(7, "\300#\2\1\0\5\0"..., 1502) = 7
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [PAP AuthAck
>> id=0x1 \"\"]"..., 61, MSG_NOSIGNAL) = 61
>>
>> as you see, the 7 bytes "\300#\2\1\0\5\0" were received successfully.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [IPCP ConfReq
>> id=0x1 <addr 192.168.2.17>]"...
>> 23:18:44 write(8, "\200!\1\1\0\n\3\6\300\250\2\21"..., 12) = 12
>>
>> and this one is never ever received by client.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [CCP ConfReq
>> id=0x1]"...
>> 23:18:44 write(8, "\200\375\1\1\0\4"..., 6) = 6
>>
>> client:
>> 23:18:44 read(8, "\200\375\1\1\0\4"..., 1502) = 6
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [CCP ConfReq
>> id=0x1]"...
>>
>> and again, this 6-char string gets received ok.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [CCP ConfRej
>> id=0x1 <deflate 15>...
>> 23:18:44 write(8, "\200\375\4\1\0\17\32\4x\0\30\4x\0\25\3/"..., 17) = 17
>>
>> client:
>> 23:18:44 read(8, "\200\375\4\1\0\17\32\4x\0\30\4x\0\25\3/"..., 1502) = 17
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [CCP ConfRej
>> id=0x1 <deflate 15>...
>>
>> got this 17-char string ok.
>>
>> server, after some more exchanges which are all ok, repeats the IP
>> request:
>> 23:18:47 send(3, "<31>Jul 25 23:18:47 pppd[3199]: sent [IPCP ConfReq
>> id=0x1 <addr 192.168.2.17>]"...
>> 23:18:47 write(8, "\200!\1\1\0\n\3\6\300\250\2\21"..., 12) = 12
>>
>> and again, this request never reaches the other end....
>>
>> and finally the client disconnects, timing out waiting for the addresses
>> being agreed upon.
>>
>> Another thing that never reaches client:
>>
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [IPCP ConfRej
>> id=0x1 <compress VJ 0f 01>]"...
>> 23:18:44 write(8, "\200!\4\1\0\n\2\6\0-\17\1"..., 12) = 12
>>
>> So, either we've issue with 12-byte strings sent from kvm to host
>> (no 12-byte string gets received actually, but those mentioned are
>> the only sent), or an issue with certain character (sequence) --
>> but I see all the individual chars in other places -- maybe only
>> except \6 (ACK).
>>
>> Exact same config, on exact same machine but on host (not guest)
>> worked for
>> some 10 years already, and works today still. Client immediately sees
>> the
>> IPCP ConfReq message and connection progresses.
>>
>>
>>
>> That was long and tiring excercise. Now something simpler: stty
>> outputs on
>> both host and guest for the same (physical) serial port while pppd is
>> running
>> in guest.
>>
>> GUEST:
>> speed 57600 baud; rows 0; columns 0; line = 3;
>> intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
>> eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
>> rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
>> -parenb -parodd cs8 hupcl -cstopb cread -clocal crtscts
>> ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl
>> -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
>> -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
>> bs0 vt0 ff0
>> -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase
>> -tostop -echoprt -echoctl -echoke
>>
>> HOST:
>> speed 57600 baud; rows 0; columns 0; line = 0;
>> intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
>> eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
>> rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
>> -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
>> -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl
>> -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
>> opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
>> bs0 vt0 ff0
>> -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop
>> -echoprt echoctl echoke
>>
>>
>> wtf. The line discipline is wrong, it looks like. Especially important
>> is opost (together with onlcr) on host: it's output processing which gets
>> enabled while it should not be. Guest correctly turned it off. Also of
>> interest is echoctl but it's not that important. For others, like
>> local/-local
>> and crtscts/-crtscts I can imagine the difference since kvm should
>> pass the
>> info to guest instead of beiong blocked itself.
>>
>>
>> Any comments on all this?
>>
>> Thanks!
>>
>> /mjt
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: KVM list <kvm@vger.kernel.org>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: serial port again
Date: Fri, 21 Aug 2009 18:34:39 +0400 [thread overview]
Message-ID: <4A8EB07F.10703@msgid.tls.msk.ru> (raw)
In-Reply-To: <4A8E6282.8030704@msgid.tls.msk.ru>
[Adding qemu-devel@ since kvm@ is not interested
and since serial port seems to be qemu thing]
Michael Tokarev wrote:
> Is it just me with this issue? Anyone who has serial port
> working for anything more than serial console (that is, with
> control chars etc, not only text) ?
I just ran a quick test. Telling pppd(8) to escape all
control characters on both ends (default-asyncmap option)
let the connection to run. So kvm/qemu interprets (some)
control characters or sequences somehow.
Anyone here who's able to tell something about the
8bit cleaness of the qemu serial ports?
Thanks!
> Michael Tokarev wrote at Sun, 26 Jul 2009 00:09:57 +0400:
>> Finally, I'm trying to use serial port in a kvm guest.
>> And as in my previous attempt, it does not quite work.
>>
>> qemu-kvm-0.10.5, 2.6.27.latest guest, 2.6.30.latest host.
>>
>> Running pppd over real serial/model lines for now. Dialing
>> into kvm virtual machine from another location, kvm pppd
>> acts as dial-in server. Authentication succeeded, 2 pppd
>> starts exchanging options. But at least one option never
>> reaches the dialing in machine from a ppp server.
>>
>> Here's some straces. I'm omitting client to server
>> communicatiins, leaving only server to client.
>>
>> server:
>> 23:18:43 send(3, "<31>Jul 25 23:18:43 pppd[3199]: sent [PAP AuthAck
>> id=0x1 \"\"]"..., 60, MSG_NOSIGNAL) = 60
>> 23:18:43 write(7, "\300#\2\1\0\5\0"..., 7) = 7
>>
>> client:
>> 23:18:44 read(7, "\300#\2\1\0\5\0"..., 1502) = 7
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [PAP AuthAck
>> id=0x1 \"\"]"..., 61, MSG_NOSIGNAL) = 61
>>
>> as you see, the 7 bytes "\300#\2\1\0\5\0" were received successfully.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [IPCP ConfReq
>> id=0x1 <addr 192.168.2.17>]"...
>> 23:18:44 write(8, "\200!\1\1\0\n\3\6\300\250\2\21"..., 12) = 12
>>
>> and this one is never ever received by client.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [CCP ConfReq
>> id=0x1]"...
>> 23:18:44 write(8, "\200\375\1\1\0\4"..., 6) = 6
>>
>> client:
>> 23:18:44 read(8, "\200\375\1\1\0\4"..., 1502) = 6
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [CCP ConfReq
>> id=0x1]"...
>>
>> and again, this 6-char string gets received ok.
>>
>> server:
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [CCP ConfRej
>> id=0x1 <deflate 15>...
>> 23:18:44 write(8, "\200\375\4\1\0\17\32\4x\0\30\4x\0\25\3/"..., 17) = 17
>>
>> client:
>> 23:18:44 read(8, "\200\375\4\1\0\17\32\4x\0\30\4x\0\25\3/"..., 1502) = 17
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[31168]: rcvd [CCP ConfRej
>> id=0x1 <deflate 15>...
>>
>> got this 17-char string ok.
>>
>> server, after some more exchanges which are all ok, repeats the IP
>> request:
>> 23:18:47 send(3, "<31>Jul 25 23:18:47 pppd[3199]: sent [IPCP ConfReq
>> id=0x1 <addr 192.168.2.17>]"...
>> 23:18:47 write(8, "\200!\1\1\0\n\3\6\300\250\2\21"..., 12) = 12
>>
>> and again, this request never reaches the other end....
>>
>> and finally the client disconnects, timing out waiting for the addresses
>> being agreed upon.
>>
>> Another thing that never reaches client:
>>
>> 23:18:44 send(3, "<31>Jul 25 23:18:44 pppd[3199]: sent [IPCP ConfRej
>> id=0x1 <compress VJ 0f 01>]"...
>> 23:18:44 write(8, "\200!\4\1\0\n\2\6\0-\17\1"..., 12) = 12
>>
>> So, either we've issue with 12-byte strings sent from kvm to host
>> (no 12-byte string gets received actually, but those mentioned are
>> the only sent), or an issue with certain character (sequence) --
>> but I see all the individual chars in other places -- maybe only
>> except \6 (ACK).
>>
>> Exact same config, on exact same machine but on host (not guest)
>> worked for
>> some 10 years already, and works today still. Client immediately sees
>> the
>> IPCP ConfReq message and connection progresses.
>>
>>
>>
>> That was long and tiring excercise. Now something simpler: stty
>> outputs on
>> both host and guest for the same (physical) serial port while pppd is
>> running
>> in guest.
>>
>> GUEST:
>> speed 57600 baud; rows 0; columns 0; line = 3;
>> intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
>> eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
>> rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
>> -parenb -parodd cs8 hupcl -cstopb cread -clocal crtscts
>> ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl
>> -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
>> -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
>> bs0 vt0 ff0
>> -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase
>> -tostop -echoprt -echoctl -echoke
>>
>> HOST:
>> speed 57600 baud; rows 0; columns 0; line = 0;
>> intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
>> eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
>> rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
>> -parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
>> -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl
>> -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
>> opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
>> bs0 vt0 ff0
>> -isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop
>> -echoprt echoctl echoke
>>
>>
>> wtf. The line discipline is wrong, it looks like. Especially important
>> is opost (together with onlcr) on host: it's output processing which gets
>> enabled while it should not be. Guest correctly turned it off. Also of
>> interest is echoctl but it's not that important. For others, like
>> local/-local
>> and crtscts/-crtscts I can imagine the difference since kvm should
>> pass the
>> info to guest instead of beiong blocked itself.
>>
>>
>> Any comments on all this?
>>
>> Thanks!
>>
>> /mjt
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-08-21 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-25 20:09 serial port again Michael Tokarev
2009-08-21 9:01 ` Michael Tokarev
2009-08-21 14:34 ` Michael Tokarev [this message]
2009-08-21 14:34 ` [Qemu-devel] " Michael Tokarev
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=4A8EB07F.10703@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=kvm@vger.kernel.org \
--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.