static const char default_cdev[] = "vhost-net";
static struct fuse_session *session;
-struct vhost_net_device_ops const *ops;
/*
* Returns vhost_device_ctx from given fuse_req_t. The index is populated later
struct vhost_device_ctx ctx = fuse_req_to_vhost_ctx(req, fi);
int err = 0;
- err = ops->new_device(ctx);
+ err = vhost_new_device(ctx);
if (err == -1) {
fuse_reply_err(req, EPERM);
return;
int err = 0;
struct vhost_device_ctx ctx = fuse_req_to_vhost_ctx(req, fi);
- ops->destroy_device(ctx);
+ vhost_destroy_device(ctx);
RTE_LOG(INFO, VHOST_CONFIG, "(%"PRIu64") Device released\n", ctx.fh);
fuse_reply_err(req, err);
}
case VHOST_GET_FEATURES:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_GET_FEATURES\n", ctx.fh);
- VHOST_IOCTL_W(uint64_t, features, ops->get_features);
+ VHOST_IOCTL_W(uint64_t, features, vhost_get_features);
break;
case VHOST_SET_FEATURES:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_SET_FEATURES\n", ctx.fh);
- VHOST_IOCTL_R(uint64_t, features, ops->set_features);
+ VHOST_IOCTL_R(uint64_t, features, vhost_set_features);
break;
case VHOST_RESET_OWNER:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_RESET_OWNER\n", ctx.fh);
- VHOST_IOCTL(ops->reset_owner);
+ VHOST_IOCTL(vhost_reset_owner);
break;
case VHOST_SET_OWNER:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_SET_OWNER\n", ctx.fh);
- VHOST_IOCTL(ops->set_owner);
+ VHOST_IOCTL(vhost_set_owner);
break;
case VHOST_SET_MEM_TABLE:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_SET_VRING_NUM\n", ctx.fh);
VHOST_IOCTL_R(struct vhost_vring_state, state,
- ops->set_vring_num);
+ vhost_set_vring_num);
break;
case VHOST_SET_VRING_BASE:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_SET_VRING_BASE\n", ctx.fh);
VHOST_IOCTL_R(struct vhost_vring_state, state,
- ops->set_vring_base);
+ vhost_set_vring_base);
break;
case VHOST_GET_VRING_BASE:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_GET_VRING_BASE\n", ctx.fh);
VHOST_IOCTL_RW(uint32_t, index,
- struct vhost_vring_state, state, ops->get_vring_base);
+ struct vhost_vring_state, state, vhost_get_vring_base);
break;
case VHOST_SET_VRING_ADDR:
LOG_DEBUG(VHOST_CONFIG,
"(%"PRIu64") IOCTL: VHOST_SET_VRING_ADDR\n", ctx.fh);
VHOST_IOCTL_R(struct vhost_vring_addr, addr,
- ops->set_vring_addr);
+ vhost_set_vring_addr);
break;
case VHOST_SET_VRING_KICK:
}
file.fd = fd;
if (cmd == VHOST_SET_VRING_KICK) {
- result = ops->set_vring_kick(ctx, &file);
+ result = vhost_set_vring_kick(ctx, &file);
fuse_reply_ioctl(req, result, NULL, 0);
} else {
- result = ops->set_vring_call(ctx, &file);
+ result = vhost_set_vring_call(ctx, &file);
fuse_reply_ioctl(req, result, NULL, 0);
}
}
cuse_info.dev_info_argv = device_argv;
cuse_info.flags = CUSE_UNRESTRICTED_IOCTL;
- ops = get_virtio_net_callbacks();
-
session = cuse_lowlevel_setup(3, fuse_argv,
&cuse_info, &vhost_net_ops, 0, NULL);
if (session == NULL)