vhost: get internal ops when registering
vhost_net_device_ops is internal implementation in vhost lib. register_cuse_device will be vhost driver register API. There is no need for it to know the internal vhost ops. Instead, that ops is retrieved in register_cuse_device through get_virtio_net_callbacks. Signed-off-by: Huawei Xie <huawei.xie@intel.com> Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
This commit is contained in:
parent
17b8320a3e
commit
f782576959
@ -122,8 +122,6 @@ struct virtio_net_device_ops {
|
||||
int init_virtio_net(struct virtio_net_device_ops const * const);
|
||||
int deinit_virtio_net(void);
|
||||
|
||||
struct vhost_net_device_ops const * get_virtio_net_callbacks(void);
|
||||
|
||||
/**
|
||||
* Function to convert guest physical addresses to vhost virtual addresses.
|
||||
* This is used to convert guest virtio buffer addresses.
|
||||
|
@ -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, struct vhost_net_device_ops const * const pops)
|
||||
register_cuse_device(const char *base_name)
|
||||
{
|
||||
struct cuse_info cuse_info;
|
||||
char device_name[PATH_MAX] = "";
|
||||
@ -339,7 +339,7 @@ register_cuse_device(const char *base_name, struct vhost_net_device_ops const *
|
||||
cuse_info.dev_info_argv = device_argv;
|
||||
cuse_info.flags = CUSE_UNRESTRICTED_IOCTL;
|
||||
|
||||
ops = pops;
|
||||
ops = get_virtio_net_callbacks();
|
||||
|
||||
session = cuse_lowlevel_setup(3, fuse_argv,
|
||||
&cuse_info, &vhost_net_ops, 0, NULL);
|
||||
|
@ -80,4 +80,5 @@ struct vhost_net_device_ops {
|
||||
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_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user