[PATCH v6 15/25] lib/librte_vhost: rte_vhost_driver_register and rte_vhost_session_start API
From: Huawei Xie <hidden>
Date: 2014-10-08 18:54:49
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
rename register_cuse_device as rte_vhost_driver_register API. rename start_session_loop as rte_vhost_driver_session_start API. Signed-off-by: Huawei Xie <redacted> --- lib/librte_vhost/rte_virtio_net.h | 5 +++++ lib/librte_vhost/vhost-net-cdev.c | 4 ++-- lib/librte_vhost/vhost-net-cdev.h | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h
index 1f2b351..3ca1d63 100644
--- a/lib/librte_vhost/rte_virtio_net.h
+++ b/lib/librte_vhost/rte_virtio_net.h@@ -123,4 +123,9 @@ int init_virtio_net(struct virtio_net_device_ops const * const); int deinit_virtio_net(void); +/* Register vhost driver. dev_name could be different for multiple instance support. */ +int rte_vhost_driver_register(const char *dev_name); + +/* Start vhost driver session blocking loop. */ +int rte_vhost_driver_session_start(void); #endif /* _VIRTIO_NET_H_ */
diff --git a/lib/librte_vhost/vhost-net-cdev.c b/lib/librte_vhost/vhost-net-cdev.c
index 4eeb676..d9d24bc 100644
--- a/lib/librte_vhost/vhost-net-cdev.c
+++ b/lib/librte_vhost/vhost-net-cdev.c@@ -302,7 +302,7 @@ static const struct cuse_lowlevel_ops vhost_net_ops = { * also passed when the device is registered in main.c. */ int -register_cuse_device(const char *base_name) +rte_vhost_driver_register(const char *dev_name) { struct cuse_info cuse_info; char device_name[PATH_MAX] = "";
@@ -353,7 +353,7 @@ register_cuse_device(const char *base_name) * The CUSE session is launched allowing the application to receive open, release and ioctl calls. */ int -start_cuse_session_loop(void) +rte_vhost_driver_session_start(void) { fuse_session_loop(session);
diff --git a/lib/librte_vhost/vhost-net-cdev.h b/lib/librte_vhost/vhost-net-cdev.h
index 0db8f0a..fa67caf 100644
--- a/lib/librte_vhost/vhost-net-cdev.h
+++ b/lib/librte_vhost/vhost-net-cdev.h@@ -77,8 +77,6 @@ struct vhost_net_device_ops { int (* reset_owner) (struct vhost_device_ctx); }; -int register_cuse_device(const char *base_name, int index, struct vhost_net_device_ops const * const); -int start_cuse_session_loop(void); struct vhost_net_device_ops const *get_virtio_net_callbacks(void); #endif /* _VHOST_NET_CDEV_H_ */
--
1.8.1.4