mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #1045 from zzambers/spinlocks-hyperv-feature
Add support for spinlocks hyperv feature
This commit is contained in:
commit
9cc710bb4e
@ -1258,6 +1258,8 @@ Vagrant.configure("2") do |config|
|
|||||||
libvirt.hyperv_feature :name => 'relaxed', :state => 'on'
|
libvirt.hyperv_feature :name => 'relaxed', :state => 'on'
|
||||||
# Enable virtual APIC
|
# Enable virtual APIC
|
||||||
libvirt.hyperv_feature :name => 'vapic', :state => 'on'
|
libvirt.hyperv_feature :name => 'vapic', :state => 'on'
|
||||||
|
# Enable spinlocks (requires retries to be specified)
|
||||||
|
libvirt.hyperv_feature :name => 'spinlocks', :state => 'on', :retries => '8191'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
@ -237,7 +237,11 @@ module VagrantPlugins
|
|||||||
env[:ui].info(" -- Feature: #{feature}")
|
env[:ui].info(" -- Feature: #{feature}")
|
||||||
end
|
end
|
||||||
@features_hyperv.each do |feature|
|
@features_hyperv.each do |feature|
|
||||||
env[:ui].info(" -- Feature (HyperV): name=#{feature[:name]}, state=#{feature[:state]}")
|
if feature[:name] == 'spinlocks'
|
||||||
|
env[:ui].info(" -- Feature (HyperV): name=#{feature[:name]}, state=#{feature[:state]}, retries=#{feature[:retries]}")
|
||||||
|
else
|
||||||
|
env[:ui].info(" -- Feature (HyperV): name=#{feature[:name]}, state=#{feature[:state]}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
env[:ui].info(" -- Clock offset: #{@clock_offset}")
|
env[:ui].info(" -- Clock offset: #{@clock_offset}")
|
||||||
@clock_timers.each do |timer|
|
@clock_timers.each do |timer|
|
||||||
|
@ -398,10 +398,20 @@ module VagrantPlugins
|
|||||||
raise 'Feature name AND state must be specified'
|
raise 'Feature name AND state must be specified'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if options[:name] == 'spinlocks' && options[:retries].nil?
|
||||||
|
raise 'Feature spinlocks requires retries parameter'
|
||||||
|
end
|
||||||
|
|
||||||
@features_hyperv = [] if @features_hyperv == UNSET_VALUE
|
@features_hyperv = [] if @features_hyperv == UNSET_VALUE
|
||||||
|
|
||||||
@features_hyperv.push(name: options[:name],
|
if options[:name] == 'spinlocks'
|
||||||
state: options[:state])
|
@features_hyperv.push(name: options[:name],
|
||||||
|
state: options[:state],
|
||||||
|
retries: options[:retries])
|
||||||
|
else
|
||||||
|
@features_hyperv.push(name: options[:name],
|
||||||
|
state: options[:state])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def clock_timer(options = {})
|
def clock_timer(options = {})
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<% if !@features_hyperv.empty? %>
|
<% if !@features_hyperv.empty? %>
|
||||||
<hyperv>
|
<hyperv>
|
||||||
<% @features_hyperv.each do |feature| %>
|
<% @features_hyperv.each do |feature| %>
|
||||||
<<%= feature[:name] %> state='<%= feature[:state] %>' />
|
<<%= feature[:name] %> state='<%= feature[:state] %>'<% if feature[:name] == 'spinlocks' %> retries='<%= feature[:retries] %>'<% end %> />
|
||||||
<% end %>
|
<% end %>
|
||||||
</hyperv>
|
</hyperv>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
<pae/>
|
<pae/>
|
||||||
<hyperv>
|
<hyperv>
|
||||||
<BBB state='on' />
|
<BBB state='on' />
|
||||||
|
<spinlocks state='on' retries='4096' />
|
||||||
</hyperv>
|
</hyperv>
|
||||||
</features>
|
</features>
|
||||||
<clock offset='variable'>
|
<clock offset='variable'>
|
||||||
|
@ -43,6 +43,7 @@ describe 'templates/domain' do
|
|||||||
domain.clock_offset = 'variable'
|
domain.clock_offset = 'variable'
|
||||||
domain.clock_timer(name: 't1')
|
domain.clock_timer(name: 't1')
|
||||||
domain.clock_timer(name: 't2', track: 'b', tickpolicy: 'c', frequency: 'd', mode: 'e', present: 'yes')
|
domain.clock_timer(name: 't2', track: 'b', tickpolicy: 'c', frequency: 'd', mode: 'e', present: 'yes')
|
||||||
|
domain.hyperv_feature(name: 'spinlocks', state: 'on', retries: '4096')
|
||||||
domain.cputopology(sockets: '1', cores: '3', threads: '2')
|
domain.cputopology(sockets: '1', cores: '3', threads: '2')
|
||||||
domain.machine_type = 'pc-compatible'
|
domain.machine_type = 'pc-compatible'
|
||||||
domain.machine_arch = 'x86_64'
|
domain.machine_arch = 'x86_64'
|
||||||
|
Loading…
Reference in New Issue
Block a user