UsingVhost: Difference between revisions
From KVM
(wrong unit) |
No edit summary |
||
Line 17: | Line 17: | ||
To start a guest with vhost: | To start a guest with vhost: | ||
* /usr/bin/kvm -netdev type=tap,id=guest0,script=kvm-ifup,vhost=on -device virtio-net-pci,netdev=guest0,mac=00:16:3e:00:00:01 ..other options.. | * /usr/bin/kvm -netdev type=tap,id=guest0,script=kvm-ifup,vhost=on -device virtio-net-pci,netdev=guest0,mac=00:16:3e:00:00:01 ..other options.. | ||
=== Caveats === | |||
Some DHCP clients have problems with this implementation, more [http://www.spinics.net/lists/kvm/msg37660.html details here]. |
Revision as of 04:36, 20 September 2010
As of September 2010, vhost is not included in any released tarballs, so you need the git version.
VhostNet provides better latency (10% less than e1000 on my system) and greater throughput (8x the normal virtio, around 7~8 Gigabits/sec here) for network.
Obtaining the code
- git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
- git checkout refs/remotes/origin/stable-0.13
- cd kvm
- compile as usual
kernel requirements
On the host you need a kernel with CONFIG_VHOST_NET=y and in the guest you need a kernel with CONFIG_PCI_MSI=y
example command line
To start a guest with vhost:
- /usr/bin/kvm -netdev type=tap,id=guest0,script=kvm-ifup,vhost=on -device virtio-net-pci,netdev=guest0,mac=00:16:3e:00:00:01 ..other options..
Caveats
Some DHCP clients have problems with this implementation, more details here.