* [Qemu-devel] CharUDP - Connection refused
@ 2015-10-04 15:01 poma
2015-10-05 15:18 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: poma @ 2015-10-04 15:01 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Cc: libvir-list, Gal Hammer, Paolo Bonzini, Amit Shah, Cole Robinson
Hi Fi
With or without the patch[1] the same result - "Connection refused".
UDP network console,
the character device acts as a UDP netconsole service, sending and receiving packets.
This is a lossy service.
= HOST:
virt-manager:
Add New Virtual Serial Device
Device Type: UDP net cosnole (udp)
Host: 127.0.0.1 Port: 4555
Bind Host: Server mode (bind)
Serial Device 1 (Primary Console)
Device Type: udp
Source host: 127.0.0.1:4555
Bind host: 127.0.0.1:4556
/etc/libvirt/qemu/domain.xml
...
<serial type='udp'>
<source mode='bind' host='127.0.0.1' service='4556'/>
<source mode='connect' host='127.0.0.1' service='4555'/>
<target port='0'/>
</serial>
<console type='udp'>
<source mode='bind' host='127.0.0.1' service='4556'/>
<source mode='connect' host='127.0.0.1' service='4555'/>
<target type='serial' port='0'/>
</console>
qemu-system-x86_64 ... \
-chardev udp,id=charserial0,host=127.0.0.1,port=4555,localaddr=127.0.0.1,localport=4556 \
-device isa-serial,chardev=charserial0,id=serial0
# netstat -an | grep 4555
udp 0 0 127.0.0.1:4556 127.0.0.1:4555 ESTABLISHED
# nc -vv -u 127.0.0.1 4555
Ncat: Version 6.47 ( http://nmap.org/ncat )
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_udp(): UDP connection requested to 127.0.0.1:4555 (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT SUCCESS for EID 8 [127.0.0.1:4555]
Ncat: Connected to 127.0.0.1:4555.
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock nsock_read(): Read request from IOD #1 [127.0.0.1:4555] (timeout: -1ms) EID 18
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 26
libnsock nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 26 [peer unspecified] (1 bytes): .
libnsock nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 35 [127.0.0.1:4555]
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 42
libnsock nsock_trace_handler_callback(): Callback: READ ERROR [Connection refused (111)] for EID 18 [127.0.0.1:4555]
Ncat: Connection refused.
# nc -vv -u 127.0.0.1 4556
Ncat: Version 6.47 ( http://nmap.org/ncat )
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_udp(): UDP connection requested to 127.0.0.1:4556 (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT SUCCESS for EID 8 [127.0.0.1:4556]
Ncat: Connected to 127.0.0.1:4556.
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock nsock_read(): Read request from IOD #1 [127.0.0.1:4556] (timeout: -1ms) EID 18
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 26
libnsock nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 26 [peer unspecified] (1 bytes): .
libnsock nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 35 [127.0.0.1:4556]
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer unspecified] EID 42
libnsock nsock_trace_handler_callback(): Callback: READ ERROR [Connection refused (111)] for EID 18 [127.0.0.1:4556]
Ncat: Connection refused.
# socat -d -d UDP:127.0.0.1:4555 -
2015/10/04 13:18:29 socat[5655] N opening connection to AF=2 127.0.0.1:4555
2015/10/04 13:18:29 socat[5655] N successfully connected from local address AF=2 127.0.0.1:40785
2015/10/04 13:18:29 socat[5655] N reading from and writing to stdio
2015/10/04 13:18:29 socat[5655] N starting data transfer loop with FDs [3,3] and [0,1]
2015/10/04 13:18:34 socat[5655] E read(3, 0x557184904210, 8192): Connection refused
2015/10/04 13:18:34 socat[5655] N exit(1)
# socat -d -d UDP:127.0.0.1:4556 -
2015/10/04 13:18:47 socat[5658] N opening connection to AF=2 127.0.0.1:4556
2015/10/04 13:18:47 socat[5658] N successfully connected from local address AF=2 127.0.0.1:49650
2015/10/04 13:18:47 socat[5658] N reading from and writing to stdio
2015/10/04 13:18:47 socat[5658] N starting data transfer loop with FDs [3,3] and [0,1]
2015/10/04 13:18:51 socat[5658] E read(3, 0x561b414be210, 8192): Connection refused
2015/10/04 13:18:51 socat[5658] N exit(1)
How is it supposed to work?
= DOMAIN:
$ hostnamectl status | egrep Chassis\|Virtualization
Chassis: vm
Virtualization: kvm
$ cat /proc/cmdline
BOOT_IMAGE=vmlinuz0 initrd=initrd0.img root=live:CDLABEL=Rawhide-Xfce-Live-1003 rootfstype=auto ro rd.live.image console=tty0 console=ttyS0
$ systemctl status serial-getty@ttyS0.service
● serial-getty@ttyS0.service - Serial Getty on ttyS0
Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2015-10-04 09:02:06 EDT; 48s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Main PID: 1109 (agetty)
CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty@ttyS0.service
└─1109 /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt220
Oct 04 09:02:06 localhost systemd[1]: Started Serial Getty on ttyS0.
= SW VERSIONS:
$ qemu-system-x86_64 -version
QEMU emulator version 2.4.0.1 (qemu-2.4.0.1-2.fc24), Copyright (c) 2003-2008 Fabrice Bellard
$ libvirtd --version
libvirtd (libvirt) 1.2.20
$ virt-manager --version
1.2.1
$ rpm -q qemu libvirt virt-manager
qemu-2.4.0.1-2.fc24.x86_64
libvirt-1.2.20-1.fc24.x86_64
virt-manager-1.2.1-3.fc24.noarch
[1]
char: udp chardev shouldn't require an explicit open.
http://patchwork.ozlabs.org/patch/311730
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] CharUDP - Connection refused
2015-10-04 15:01 [Qemu-devel] CharUDP - Connection refused poma
@ 2015-10-05 15:18 ` Paolo Bonzini
2015-10-05 16:21 ` poma
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2015-10-05 15:18 UTC (permalink / raw)
To: poma, qemu-devel@nongnu.org
Cc: libvir-list, Gal Hammer, Amit Shah, Cole Robinson
On 04/10/2015 17:01, poma wrote:
>
> qemu-system-x86_64 ... \
> -chardev udp,id=charserial0,host=127.0.0.1,port=4555,localaddr=127.0.0.1,localport=4556 \
> -device isa-serial,chardev=charserial0,id=serial0
>
>
> # netstat -an | grep 4555
> udp 0 0 127.0.0.1:4556 127.0.0.1:4555 ESTABLISHED
>
> How is it supposed to work?
You should use "nc -up 4555 localhost 4556". Just like QEMU needs both
ends, so does nc (the source host can also be specified, optionally,
with nc's -s option).
Paolo
>
> = DOMAIN:
>
> $ hostnamectl status | egrep Chassis\|Virtualization
> Chassis: vm
> Virtualization: kvm
>
> $ cat /proc/cmdline
> BOOT_IMAGE=vmlinuz0 initrd=initrd0.img root=live:CDLABEL=Rawhide-Xfce-Live-1003 rootfstype=auto ro rd.live.image console=tty0 console=ttyS0
>
> $ systemctl status serial-getty@ttyS0.service
> ● serial-getty@ttyS0.service - Serial Getty on ttyS0
> Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; disabled; vendor preset: disabled)
> Active: active (running) since Sun 2015-10-04 09:02:06 EDT; 48s ago
> Docs: man:agetty(8)
> man:systemd-getty-generator(8)
> http://0pointer.de/blog/projects/serial-console.html
> Main PID: 1109 (agetty)
> CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty@ttyS0.service
> └─1109 /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt220
>
> Oct 04 09:02:06 localhost systemd[1]: Started Serial Getty on ttyS0.
>
>
> = SW VERSIONS:
>
> $ qemu-system-x86_64 -version
> QEMU emulator version 2.4.0.1 (qemu-2.4.0.1-2.fc24), Copyright (c) 2003-2008 Fabrice Bellard
> $ libvirtd --version
> libvirtd (libvirt) 1.2.20
> $ virt-manager --version
> 1.2.1
>
> $ rpm -q qemu libvirt virt-manager
> qemu-2.4.0.1-2.fc24.x86_64
> libvirt-1.2.20-1.fc24.x86_64
> virt-manager-1.2.1-3.fc24.noarch
>
>
> [1]
> char: udp chardev shouldn't require an explicit open.
> http://patchwork.ozlabs.org/patch/311730
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] CharUDP - Connection refused
2015-10-05 15:18 ` Paolo Bonzini
@ 2015-10-05 16:21 ` poma
0 siblings, 0 replies; 3+ messages in thread
From: poma @ 2015-10-05 16:21 UTC (permalink / raw)
To: Paolo Bonzini
Cc: libvir-list, Gal Hammer, Amit Shah, qemu-devel@nongnu.org,
Cole Robinson
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
On Mon, Oct 5, 2015 at 5:18 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 04/10/2015 17:01, poma wrote:
> >
> > qemu-system-x86_64 ... \
> > -chardev
> udp,id=charserial0,host=127.0.0.1,port=4555,localaddr=127.0.0.1,localport=4556
> \
> > -device isa-serial,chardev=charserial0,id=serial0
> >
> >
> > # netstat -an | grep 4555
> > udp 0 0 127.0.0.1:4556 127.0.0.1:4555
> ESTABLISHED
> >
> > How is it supposed to work?
>
> You should use "nc -up 4555 localhost 4556". Just like QEMU needs both
> ends, so does nc (the source host can also be specified, optionally,
> with nc's -s option).
>
> Paolo
>
>
or
socat - UDP:127.0.0.1:4556,sourceport=4555
Thanks man!
[-- Attachment #2: Type: text/html, Size: 1406 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-05 16:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-04 15:01 [Qemu-devel] CharUDP - Connection refused poma
2015-10-05 15:18 ` Paolo Bonzini
2015-10-05 16:21 ` poma
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).