Difference between VCPU and -smp for KVM Guests

kvm-virtualization

What is the difference between die the VCPU setting in the XML config files and the -smp switch for the kvm command line?

We have a i7-920 with 4 Cores and HT (which results in 8 visible/virtual cores) and want to assign each guest one real core and so 2 virtual cores through HT. What is the best way to do this?

Best Answer

I believe the VCPU stanza in the libvirt config xml's simply translates to the -smp N argument to kvm while booting. So they should be the same. You'll probably want to give 2 as the value.

You'll want linux to intelligently handle the assignment. In theory you could set the cpu affinity and select a real core and a HT one, but I doubt this will give the best results and will involve extra hurdles.