X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvhost_cuse%2Fvhost-net-cdev.c;h=1ae7c490a2a9c5fc02084f2b18dbd87dc5cd47d7;hb=621389bbbe0860d41538aeac893b6d74e714530c;hp=e7794b0aeae34b1dca960bd901fce5169fe9f2d5;hpb=c2f60667bfbec9f98c9ca622b6c1cfd9d88d027e;p=dpdk.git diff --git a/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c b/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c index e7794b0aea..1ae7c490a2 100644 --- a/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c +++ b/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c @@ -44,6 +44,7 @@ #include #include +#include "virtio-net-cdev.h" #include "vhost-net.h" #include "eventfd_copy.h" @@ -57,7 +58,7 @@ static const char cuse_device_name[] = "/dev/cuse"; static const char default_cdev[] = "vhost-net"; static struct fuse_session *session; -static struct vhost_net_device_ops const *ops; +struct vhost_net_device_ops const *ops; /* * Returns vhost_device_ctx from given fuse_req_t. The index is populated later @@ -195,7 +196,13 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void *arg, case VHOST_NET_SET_BACKEND: LOG_DEBUG(VHOST_CONFIG, "(%"PRIu64") IOCTL: VHOST_NET_SET_BACKEND\n", ctx.fh); - VHOST_IOCTL_R(struct vhost_vring_file, file, ops->set_backend); + if (!in_buf) { + VHOST_IOCTL_RETRY(sizeof(file), 0); + break; + } + file = *(const struct vhost_vring_file *)in_buf; + result = cuse_set_backend(ctx, &file); + fuse_reply_ioctl(req, result, NULL, 0); break; case VHOST_GET_FEATURES: @@ -247,8 +254,8 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void *arg, break; default: - result = ops->set_mem_table(ctx, - in_buf, mem_temp.nregions); + result = cuse_set_mem_table(ctx, in_buf, + mem_temp.nregions); if (result) fuse_reply_err(req, EINVAL); else @@ -397,6 +404,15 @@ rte_vhost_driver_register(const char *dev_name) return 0; } +/** + * An empty function for unregister + */ +int +rte_vhost_driver_unregister(const char *dev_name __rte_unused) +{ + return 0; +} + /** * The CUSE session is launched allowing the application to receive open, * release and ioctl calls.