vhost_poll_init(n->poll +VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev); vhost_poll_init(n->poll +VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev); f->private_data =n;return0; 然后在执行vhost设备的初始化vhost_dev_init,在该函数里最终调用vhost_work_init将work->fn设置为刚才设置的han...
hw/net/vhost_net.c:384:constVhostOps *vhost_ops = net->dev.vhost_ops; hw/net/vhost_net.c:431:constVhostOps *vhost_ops = net->dev.vhost_ops; hw/net/vhost_net.c:444:constVhostOps *vhost_ops = net->dev.vhost_ops;[root@bogon qemu]# [root@bogon qemu]# grep'vhost_net ='-rn ...
qemu侧 vhost_dev_init--- vsock也有 hw/block/vhost-user-blk.c:318: ret = vhost_dev_init(&s->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER,0); hw/virtio/vhost-vsock.c:345:ret = vhost_dev_init(&vsock->vhost_dev, (void*)(uintptr_t)vhostfd, hw/virtio/vhost-vsock.c:348: error...