only set the cpu model when using a custom cpu mode

according to https://libvirt.org/formatdomain.html#elementsCPU
setting the model is not supported when using "host-model" and
with recent libvirt this actually results in errors like this:
 Call to virDomainCreateWithFlags failed:
  the CPU is incompatible with host CPU:
  Host CPU does not provide required features: svm
This commit is contained in:
Evgeni Golov 2016-10-23 16:29:33 +02:00
parent 7d93d936f6
commit 517da85cee

View File

@ -7,7 +7,7 @@
<cpu mode='<%= @cpu_mode %>'>
<% if @cpu_mode != 'host-passthrough' %>
<model fallback='<%= @cpu_fallback %>'><%= @cpu_model %></model>
<model fallback='<%= @cpu_fallback %>'><% if @cpu_mode == 'custom' %><%= @cpu_model %><% end %></model>
<% if @nested %>
<feature policy='optional' name='vmx'/>
<feature policy='optional' name='svm'/>