> +struct vhost_device_user_ctx { > + int *fds; > + int fd_num; > + struct vhost_driver *drv; > +}; > + > /* > * Structure used to identify device context. > */ > @@ -83,6 +89,7 @@ struct vhost_device_ctx { > vhost_driver_type_t type; /* driver type. */ > uint64_t fh; /* Populated with fi->fh to track the > device index. */ > union { > + struct vhost_device_user_ctx user; > struct vhost_device_cuse_ctx cdev; > }; > };
Tetsuya: It is ok we define the enum ctx, but so far I don't see absolute necessity to have user ctx. Will send out RFC patch of my implementation today or next day to make it more clear. I don't understand why we keep two device lists. * in real case, will we allow to register two drivers? Besides, we have the open question whether we still need to keep the DPDK cuse driver. It requires maintenance effort and extra kernel module; Btw, your framework to allow dynamically register different vhost driver is nice! * If two drivers are simultaneously accessing the device list, we could add lock. > +user_get_device(struct vhost_device_ctx ctx) > +user_add_config_ll_entry(struct virtio_net_config_ll *new_ll_dev) > +user_rm_config_ll_entry(struct virtio_net_config_ll *ll_dev, struct > +user_get_config_ll_root(void) > +user_init_device(struct vhost_device_ctx ctx, struct virtio_net *dev)