[ovs-dev] Cannot connect to vhost-user socket created on Openvswitch with DPDK

Ryan Yang toryan123 at gmail.com
Thu Nov 26 02:21:25 UTC 2015


On Wed, Nov 25, 2015 at 10:53 PM, Aaron Conole <aconole at redhat.com> wrote:

> Ryan Yang <toryan123 at gmail.com> writes:
> > Hello All,
> >
> > I am trying to connect to vhost-user socket created on openvswitch with
> > DPDK but kept receiving following error:
> >
> > error: internal error: process exited while connecting to monitor:
> > 2015-11-25T19:19:02.192794Z qemu-kvm: -chardev
> > socket,id=charnet2,path=/usr/local/var/run/openvswitch/vhost-user-1:
> Failed
> > to connect to socket: Permission denied
> > 2015-11-25T19:19:02.193226Z qemu-kvm: -chardev
> > socket,id=charnet2,path=/usr/local/var/run/openvswitch/vhost-user-1:
> > chardev: opening backend "socket" failed
> >
> > I already made sure that the user and group are both root since I am
> using
> > root privilege and also have vhost-user socket created:
>
> Just to make sure, you qemu is running as root, too?
>

Yes, I am running it as root.

>
> > srwxr-x---. 1 root root    0 Nov 25 09:02 capabilities.monitor.sock
> > drwxr-xr-x. 3 root root 4096 Nov 25 10:05 channel
> > drwxrwxrwx. 2 root root 4096 Nov 17 21:35 dump
> > drwx--x--x. 2 root root 4096 Nov  3 21:59 nvram
> > drwxr-xr-x. 2 root root 4096 Nov 17 21:35 save
> > drwxr-xr-x. 2 root root 4096 Nov 17 21:35 snapshot
> > [root at localhost qemu]# pwd
> > /var/lib/libvirt/qemu
> > [root at localhost qemu]#
> >
> > -rw-r--r--. 1 root root      6 Nov 25 07:07 ovs-vswitchd.pid
> > -rw-r--r--. 1 root root 197120 Nov 25 07:18 vdisk.img
> > srwxr-xr-x. 1 root root      0 Nov 26 02:11 vhost-user-1
> > [root at localhost openvswitch]#
>
> If I read this right, you have a vhost socket in /var/lib/libvirt/qemu,
> but according to the following:
>

 Sorry forgot to print the path, it's in /usr/local/var/run/openvswitch.

>
> > And following is the XML that I manually added for vhost-user interface
> > creation:
> >
> > <interface type='vhostuser'>
> >       <source type='unix'
> > path='/usr/local/var/run/openvswitch/vhost-user-1' modd
> > e='client'/>
> >       <mac address='52:54:00:02:d9:01'/>
> >       <model type='virtio'/>
> >     </interface>
>
> You've said that the vhost socket is in /usr/local/var/run/openvswitch?
> Yes.



> > Tried all of the above but still has no luck. It would be really
> > appreciated if anyone could help with this issue. Thanks again!
>
> I have actually been working on some patches for the ovs-ctl script to
> use the -vhost_sock_dir directive and put sockets in a sgid
> directory. They're not ready yet, but I could put the WIP up somewhere for
> you to look and see if they give you some help.
>
> Thanks for the help! I also see there is a fix from version 1.2.18, not
sure if this is the cause.

virt-aa-helper: Fix permissions for vhost-user socket files (Michal Dubiel)



More information about the dev mailing list