vhost: add user callbacks for socket open/close
authorDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Wed, 30 Aug 2017 10:50:58 +0000 (12:50 +0200)
committerYuanhan Liu <yliu@fridaylinux.org>
Tue, 10 Oct 2017 13:54:31 +0000 (15:54 +0200)
commitefba12a78ddf6ea2f365d75ed78be2c51cc6c561
tree8baf531b32b5999956e6cada1d76d2735ef887f0
parent66a62101240bb714a6d2d5acd39010675251ffec
vhost: add user callbacks for socket open/close

Added new callbacks to notify about socket connection status.
As destroy_device is used for virtqueue processing *pause* as well as
connection close, the user has no distinction between those.

Consider the following scenario:
rte_vhost: received SET_VRING_BASE message,
           calling destroy_device() as usual

user:  end-user asks to remove the device (together with socket file),
       OK, device is not *in use* - that's NOT the behavior we want
       calling rte_vhost_driver_unregister() etc.

Instead of changing new_device/destroy_device callbacks and breaking
the ABI, a set of new functions new_connection/destroy_connection
has been added.

Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
doc/guides/prog_guide/vhost_lib.rst
lib/librte_vhost/rte_vhost.h
lib/librte_vhost/socket.c