lib/vagrant-libvirt/templates/domain.xml.erb in vagrant-libvirt-0.0.36 vs lib/vagrant-libvirt/templates/domain.xml.erb in vagrant-libvirt-0.0.37
- old
+ new
@@ -5,11 +5,11 @@
<vcpu><%= @cpus %></vcpu>
<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'/>
<% end %>
<% @cpu_features.each do |cpu_feature| %>
@@ -167,9 +167,22 @@
<% if usb[:bus] && usb[:device] %>
<address bus='<%= usb[:bus] %>' device='<%= usb[:device] %>'/>
<% end %>
</source>
</hostdev>
+ <% end %>
+ <% unless @redirdevs.empty? %>
+ <% @redirdevs.each do |redirdev| %>
+ <redirdev bus='usb' type='<%= redirdev[:type] %>'>
+ </redirdev>
+ <% end %>
+ <% unless @redirfilters.empty? %>
+ <redirfilter>
+ <% @redirfilters.each do |usbdev| %>
+ <usbdev class='<%= usbdev[:class] %>' vendor='<%= usbdev[:vendor] %>' product='<%= usbdev[:product] %>' version='<%= usbdev[:version] %>' allow='<%= usbdev[:allow] %>'/>
+ <% end %>
+ </redirfilter>
+ <% end %>
<% end %>
<% if @tpm_path -%>
<%# TPM Device -%>
<tpm model='<%= @tpm_model %>'>