From 28689ff04d1d99f69b3ae7d6ed343a8884883bc5 Mon Sep 17 00:00:00 2001 From: Huawei Xie Date: Thu, 9 Oct 2014 02:54:50 +0800 Subject: [PATCH] vhost: rename ops registering function Rename init_virtio_net as rte_vhost_callback_register API. rte_vhost_callback_register register the callbacks called when a vhost device is created and ready to be added to data processing core or is de-actived by guest. Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang --- lib/librte_vhost/rte_virtio_net.h | 4 ++-- lib/librte_vhost/virtio-net.c | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 0a38e4df69..0e9c4735a9 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -119,8 +119,6 @@ struct virtio_net_device_ops { void (* destroy_device) (volatile struct virtio_net *); /* Remove device. */ }; -int init_virtio_net(struct virtio_net_device_ops const * const); -int deinit_virtio_net(void); /** * Function to convert guest physical addresses to vhost virtual addresses. @@ -147,6 +145,8 @@ gpa_to_vva(struct virtio_net *dev, uint64_t guest_pa) /* Register vhost driver. dev_name could be different for multiple instance support. */ int rte_vhost_driver_register(const char *dev_name); +/* Register callbacks. */ +int rte_vhost_driver_callback_register(struct virtio_net_device_ops const * const); /* Start vhost driver session blocking loop. */ int rte_vhost_driver_session_start(void); diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index ee37a401be..14e657b01e 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -964,18 +964,9 @@ get_virtio_net_callbacks(void) * Register ops so that we can add/remove device to data core. */ int -init_virtio_net(struct virtio_net_device_ops const * const ops) +rte_vhost_driver_callback_register(struct virtio_net_device_ops const * const ops) { notify_ops = ops; return 0; } - -/* - * Currently not used as we Ctrl+c to exit application. - */ -int -deinit_virtio_net(void) -{ - return 0; -}