vhost: fix unregistering in client mode
authorIlya Maximets <i.maximets@samsung.com>
Thu, 21 Jul 2016 12:55:36 +0000 (15:55 +0300)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 21 Jul 2016 22:23:58 +0000 (00:23 +0200)
commit164fd396788d666d6cb48adc305a38419cd176c4
treee33345aa3eefcd7ea346a4a5ff66949220e29ae4
parent81b5d22f1d52c1ad4f6d069c14199c91f608435d
vhost: fix unregistering in client mode

Currently while calling of 'rte_vhost_driver_unregister()' connection
to QEMU will not be closed. This leads to inability to register driver
again and reconnect to same virtual machine.

This scenario is reproducible with OVS. While executing of the following
command vhost port will be re-created (will be executed
'rte_vhost_driver_register()' followed by 'rte_vhost_driver_unregister()')
network will be broken and QEMU possibly will crash:

ovs-vsctl set Interface vhost1 ofport_request=15

Fix this by closing all established connections on driver unregister and
removing of pending connections from reconnection list.

Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user/fd_man.c
lib/librte_vhost/vhost_user/fd_man.h
lib/librte_vhost/vhost_user/vhost-net-user.c