Chunduru Venkata, Ravi
2013-Sep-25 17:17 UTC
[libvirt-users] virtio channel socket bind error
Hi All, My intent is to make virtio unix channel work. I could configure the XML and launch VM and could see the port in /dev/virtio-ports <channel type='unix'> <source mode='bind' path='/tmp/appl_port'/> <target type='virtio' name='appl_port'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> When I see on the host, the unix socket is already binded and is in listening state. echo "test this" > /tmp/appl_port bash: /tmp/appl_port: No such device or address netstat -nax | grep appl_port unix 2 [ ACC ] STREAM LISTENING 15302258 /tmp/appl_port 1) Can some one please have a look and help me fix this. 2) if I don't set source mode to 'bind', it gets set to 'connect' in xml and VM fails to boot up. I would like to understand the different types of source mode. Dmesg shows below denied message for connect mode. 84616.025345] type=1400 audit(1380129082.835:210): apparmor="DENIED" operation="capable" parent=1 profile="/usr/sbin/libvirtd" pid=9804 comm="libvirtd" pid=9804 comm="libvirtd" capability=29 capname="audit_write" Thanks, -Ravi.
Chunduru Venkata, Ravi
2013-Sep-25 17:48 UTC
Re: [libvirt-users] virtio channel socket bind error
I am assuming source mode is for the host. Bind means server and connect would mean client. The other part is still pending. On host, when I run cat it gives no such device or address Or a python program to bind the socket (in my case /tmp/appl_port) it gives 'unable to connect to virtio-serial port. Error: %s', error(111, 'Connection refused')) Am I missing something? Thanks, -Ravi. From: "<Chunduru Venkata>", "Chunduru Venkata, Ravi" <schunduruvenkata@paypal.com<mailto:schunduruvenkata@paypal.com>> Date: Wednesday, September 25, 2013 10:17 AM To: "libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>" <libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>> Subject: [libvirt-users] virtio channel socket bind error Hi All, My intent is to make virtio unix channel work. I could configure the XML and launch VM and could see the port in /dev/virtio-ports <channel type='unix'> <source mode='bind' path='/tmp/appl_port'/> <target type='virtio' name='appl_port'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> When I see on the host, the unix socket is already binded and is in listening state. echo "test this" > /tmp/appl_port bash: /tmp/appl_port: No such device or address netstat -nax | grep appl_port unix 2 [ ACC ] STREAM LISTENING 15302258 /tmp/appl_port 1) Can some one please have a look and help me fix this. 2) if I don't set source mode to 'bind', it gets set to 'connect' in xml and VM fails to boot up. I would like to understand the different types of source mode. Dmesg shows below denied message for connect mode. 84616.025345] type=1400 audit(1380129082.835:210): apparmor="DENIED" operation="capable" parent=1 profile="/usr/sbin/libvirtd" pid=9804 comm="libvirtd" pid=9804 comm="libvirtd" capability=29 capname="audit_write" Thanks, -Ravi.
Chunduru Venkata, Ravi
2013-Sep-25 19:01 UTC
Re: [libvirt-users] virtio channel socket bind error
I got this working. I have to treat the port as char device on guest and unix socket on the host and that too as client. Thanks, -Ravi. From: "<Chunduru Venkata>", "Chunduru Venkata, Ravi" <schunduruvenkata@paypal.com<mailto:schunduruvenkata@paypal.com>> Date: Wednesday, September 25, 2013 10:48 AM To: "libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>" <libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>> Subject: Re: [libvirt-users] virtio channel socket bind error I am assuming source mode is for the host. Bind means server and connect would mean client. The other part is still pending. On host, when I run cat it gives no such device or address Or a python program to bind the socket (in my case /tmp/appl_port) it gives 'unable to connect to virtio-serial port. Error: %s', error(111, 'Connection refused')) Am I missing something? Thanks, -Ravi. From: "<Chunduru Venkata>", "Chunduru Venkata, Ravi" <schunduruvenkata@paypal.com<mailto:schunduruvenkata@paypal.com>> Date: Wednesday, September 25, 2013 10:17 AM To: "libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>" <libvirt-users@redhat.com<mailto:libvirt-users@redhat.com>> Subject: [libvirt-users] virtio channel socket bind error Hi All, My intent is to make virtio unix channel work. I could configure the XML and launch VM and could see the port in /dev/virtio-ports <channel type='unix'> <source mode='bind' path='/tmp/appl_port'/> <target type='virtio' name='appl_port'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> When I see on the host, the unix socket is already binded and is in listening state. echo "test this" > /tmp/appl_port bash: /tmp/appl_port: No such device or address netstat -nax | grep appl_port unix 2 [ ACC ] STREAM LISTENING 15302258 /tmp/appl_port 1) Can some one please have a look and help me fix this. 2) if I don't set source mode to 'bind', it gets set to 'connect' in xml and VM fails to boot up. I would like to understand the different types of source mode. Dmesg shows below denied message for connect mode. 84616.025345] type=1400 audit(1380129082.835:210): apparmor="DENIED" operation="capable" parent=1 profile="/usr/sbin/libvirtd" pid=9804 comm="libvirtd" pid=9804 comm="libvirtd" capability=29 capname="audit_write" Thanks, -Ravi.
Michal Privoznik
2013-Sep-26 07:37 UTC
Re: [libvirt-users] virtio channel socket bind error
On 25.09.2013 19:17, Chunduru Venkata, Ravi wrote:> Hi All, > My intent is to make virtio unix channel work. I could configure the > XML and launch VM and could see the port in /dev/virtio-ports > > <channel type='unix'> > <source mode='bind' path='/tmp/appl_port'/> > <target type='virtio' name='appl_port'/> > <address type='virtio-serial' controller='0' bus='0' port='1'/> > </channel> > > When I see on the host, the unix socket is already binded and is in > listening state. > > echo "test this" > /tmp/appl_port > bash: /tmp/appl_port: No such device or address > > netstat -nax | grep appl_port > unix 2 [ ACC ] STREAM LISTENING 15302258 /tmp/appl_port > > 1) Can some one please have a look and help me fix this.There's nothing to fix. This works as expected.> 2) if I don't set source mode to 'bind', it gets set to 'connect' in xml > and VM fails to boot up. I would like to understand the different types > of source mode.There are two modes: 'bind' and 'connect'. They represent the UNIX sockets modes. Either an application connects to something ('connect') using the socket path as unique identifier telling where to connect, or an application listens for incoming connections, again using the socket path as unique identifier. Hence, if you want to use 'connect' mode, you already need to have an application listening on the socket path when starting up a domain. Otherwise the domain will get an error while connecting to the socket. Or, you have to tell you application to connect to the socket created by 'bind' mode once the domain is started. Michal
Cristian Ciupitu
2013-Sep-27 10:23 UTC
Re: [libvirt-users] virtio channel socket bind error
On 25.09.2013 19:17, Chunduru Venkata, Ravi wrote:> Hi All, > My intent is to make virtio unix channel work. I could configure the > XML and launch VM and could see the port in /dev/virtio-ports > > <channel type='unix'> > <source mode='bind' path='/tmp/appl_port'/> > <target type='virtio' name='appl_port'/> > <address type='virtio-serial' controller='0' bus='0' port='1'/> > </channel> > > When I see on the host, the unix socket is already binded and is in > listening state. > > echo "test this" > /tmp/appl_port > bash: /tmp/appl_port: No such device or addressTry this: echo "test this" | socat - UNIX-CONNECT:/tmp/appl_port You can't write to socket files the way you write to normal files. Cheers, Cristian Ciupitu