1、qemu与vhost_user建立sock通信
vhost_user_start (qemu)
vhost_dev_init
vhost_user_get_features (VHOST_USER_GET_FEATURES)
vhost_user_get_features(获取dpdk端的feature)
rte_vhost_driver_get_features
2、qemu启动时,初始化qemu能支持的feature,保存在VirtIONet的host_features里
virtio_net_properties
3、qemu plug一个virtio设备时
virtio_bus_device_plugged
get_features
virtio_net_get_features
将第1、2两步的feature与操作,取交集;最终重新保存在VirtIODevice的host_features里,同时也保存在VirtIODevice的backend_features里;
4、虚拟机注册virtio总线
virtio_dev_probe
vp_get_features(通过io read,虚拟机异常陷出,退到qemu里)
virtio_ioport_read(qemu,读取VirtIODevice里保存的host_features)
5、虚拟机读取feature后,向qemu回ack_feature
virtio_finalize_features
virtio_set_features
virtio_ioport_write(qemu)
virtio_set_features
virtio_net_set_features
vhost_net_ack_features
vhost_net_ack_features(更新backend_features)
6、虚拟机注册一个virtio_net设备
virtnet_probe
virtio_has_feature(根据第4步获取的feature,设置virio_net的feature)
register_netdev(向guest系统注册dev设备)
virtio_device_ready
vp_set_status(向qemu通告就绪状态)
virtio_ioport_write
virtio_set_status
virtio_net_set_status
virtio_net_vhost_status
vhost_net_start
vhost_net_start_one
vhost_dev_set_features
vhost_user_set_features
vhost_user_set_features(dpdk,更新dev->features)