vhost

vhost :

架构图:

vhost_第1张图片


代码目录在Linux/drivers/vhost/ 大部分用到的代码都在vhost.c文件当中。vhost-net的代码在net.c当中。


virtio-netdev关联了两个virtqueue

struct virtnet_nic {
	/** Base pio register address */
	unsigned long ioaddr;

	/** RX/TX virtqueues */
	struct vring_virtqueue *virtqueue;

	/** RX packets handed to the NIC waiting to be filled in */
	struct list_head rx_iobufs;

	/** Pending rx packet count */
	unsigned int rx_num_iobufs;

	/** Virtio net packet header, we only need one */
	struct virtio_net_hdr empty_header;
};


参考:

http://blog.vmsplice.net/2011/09/qemu-internals-vhost-architecture.html

http://lxr.free-electrons.com/source/drivers/vhost/?v=3.2

你可能感兴趣的:(QEMU/KVM,linux,虚拟化)