> -struct vhost_net_device_ops const *get_virtio_net_callbacks(void);
> +struct vhost_net_device_ops const *get_virtio_net_callbacks(
> +             vhost_driver_type_t type);

Tetsuya:
I feel currently it is better we still keep the common 
get_virtio_net_callbacks(). 
For the message flow from control layer 1 (cuse ioctl or user sock message 
recv/xmit)---> cuse/user local message handling layer 2-> common virtio message 
handling layer 3
Layer 1 and layer 2 belong to one  module. It is that module's choice whether 
to implement callbacks between internal layer1 and layer2. We don't need to 
force that.
Besides, even that module wants to define the ops between layer 1 and layer2, 
the interface could be different between cuse/user. 
Refer to the following code for user:

vhost-user-server.c:
case VHOST_USER_SET_MEM_TABLE:
        user_set_mem_table(ctx, &msg)

virtio-net-user.c:
user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)
{

....

        ops->set_mem_table(ctx, regions, memory.nregions);
}


Reply via email to