From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj8WW-0007kS-KJ for qemu-devel@nongnu.org; Mon, 05 Oct 2015 12:22:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zj8WS-0003Zr-RB for qemu-devel@nongnu.org; Mon, 05 Oct 2015 12:22:00 -0400 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:34928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj8WS-0003Zi-Mn for qemu-devel@nongnu.org; Mon, 05 Oct 2015 12:21:56 -0400 Received: by obbzf10 with SMTP id zf10so132646457obb.2 for ; Mon, 05 Oct 2015 09:21:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <561294AA.4090507@redhat.com> References: <56113F3B.4040701@gmail.com> <561294AA.4090507@redhat.com> Date: Mon, 5 Oct 2015 18:21:55 +0200 Message-ID: From: poma Content-Type: multipart/alternative; boundary=089e0153695073e96305215de908 Subject: Re: [Qemu-devel] CharUDP - Connection refused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: libvir-list@redhat.com, Gal Hammer , Amit Shah , "qemu-devel@nongnu.org" , Cole Robinson --089e0153695073e96305215de908 Content-Type: text/plain; charset=UTF-8 On Mon, Oct 5, 2015 at 5:18 PM, Paolo Bonzini 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! --089e0153695073e96305215de908 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On M= on, 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=3Dcharserial0,host=3D127.0.0.1,port=3D4555,localaddr= =3D127.0.0.1,localport=3D4556 \
> -device isa-serial,chardev=3Dcharserial0,id=3Dserial0
>
>
> # netstat -an | grep 4555
> udp=C2=A0 =C2=A0 =C2=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A0 0 127.0.0.1:4556= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 127.0.0.1:4555=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ESTABLISHED
>
> How is it supposed to work?

You should use "nc -up 4555 localhost 4556".=C2=A0 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=3D4555

Thanks man!

--089e0153695073e96305215de908-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zikmx-0005h1-1P for qemu-devel@nongnu.org; Sun, 04 Oct 2015 11:01:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zikmt-0008RV-Or for qemu-devel@nongnu.org; Sun, 04 Oct 2015 11:01:22 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:34977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zikmt-0008RM-FG for qemu-devel@nongnu.org; Sun, 04 Oct 2015 11:01:19 -0400 Received: by wicge5 with SMTP id ge5so88641798wic.0 for ; Sun, 04 Oct 2015 08:01:18 -0700 (PDT) From: poma Message-ID: <56113F3B.4040701@gmail.com> Date: Sun, 4 Oct 2015 17:01:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] CharUDP - Connection refused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: libvir-list@redhat.com, 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 ... 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj7Wo-00017d-CR for qemu-devel@nongnu.org; Mon, 05 Oct 2015 11:18:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zj7Wh-0002QW-KA for qemu-devel@nongnu.org; Mon, 05 Oct 2015 11:18:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zj7Wh-0002QO-Ew for qemu-devel@nongnu.org; Mon, 05 Oct 2015 11:18:07 -0400 References: <56113F3B.4040701@gmail.com> From: Paolo Bonzini Message-ID: <561294AA.4090507@redhat.com> Date: Mon, 5 Oct 2015 17:18:02 +0200 MIME-Version: 1.0 In-Reply-To: <56113F3B.4040701@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] CharUDP - Connection refused List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: poma , "qemu-devel@nongnu.org" Cc: libvir-list@redhat.com, Gal Hammer , Amit Shah , Cole Robinson On 04/10/2015 17:01, poma wrote: >=20 > qemu-system-x86_64 ... \ > -chardev udp,id=3Dcharserial0,host=3D127.0.0.1,port=3D4555,localaddr=3D= 127.0.0.1,localport=3D4556 \ > -device isa-serial,chardev=3Dcharserial0,id=3Dserial0 >=20 >=20 > # netstat -an | grep 4555 > udp 0 0 127.0.0.1:4556 127.0.0.1:4555 EST= ABLISHED >=20 > 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 >=20 > =3D DOMAIN: >=20 > $ hostnamectl status | egrep Chassis\|Virtualization > Chassis: vm > Virtualization: kvm >=20 > $ cat /proc/cmdline=20 > BOOT_IMAGE=3Dvmlinuz0 initrd=3Dinitrd0.img root=3Dlive:CDLABEL=3DRawhid= e-Xfce-Live-1003 rootfstype=3Dauto ro rd.live.image console=3Dtty0 consol= e=3DttyS0 >=20 > $ systemctl status serial-getty@ttyS0.service=20 > =E2=97=8F serial-getty@ttyS0.service - Serial Getty on ttyS0 > Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; disab= led; 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@ttyS= 0.service > =E2=94=94=E2=94=801109 /sbin/agetty --keep-baud 115200 38400= 9600 ttyS0 vt220 >=20 > Oct 04 09:02:06 localhost systemd[1]: Started Serial Getty on ttyS0. >=20 >=20 > =3D SW VERSIONS: >=20 > $ 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 >=20 > $ 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 >=20 >=20 > [1] > char: udp chardev shouldn't require an explicit open. > http://patchwork.ozlabs.org/patch/311730 >=20 >=20