UsingVhost: Difference between revisions

From KVM
No edit summary
 
m (drop irrelevant command-line arguments in the example, to show only net-related ones)
Line 15: Line 15:


=== example command line ===
=== example command line ===
To start a guest with vhost"
To start a guest with vhost:
* /usr/bin/kvm -m 1024 -netdev type=tap,id=guest0,script=kvm-ifup,vhost=on -device virtio-net-pci,netdev=guest0,mac=00:16:3e:00:00:01 -drive file=/dev/volume01/guest0,if=virtio,boot=on -daemonize
* /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..

Revision as of 08:07, 15 September 2010

As of September 2010, vhost is not included in any released tarballs, so you need the git version.

Vhost provides better latency (10% less than e1000 on my system) and greater throughput (8x the normal virtio, around 7~8 Gigabytes/sec here) for network.

Obtaining the code

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..