mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Allow changing disk bus
This commit is contained in:
parent
14439fe569
commit
f277c1119c
@ -20,6 +20,7 @@ module VagrantPlugins
|
|||||||
@name = env[:domain_name]
|
@name = env[:domain_name]
|
||||||
@cpus = config.cpus
|
@cpus = config.cpus
|
||||||
@cpu_mode = config.cpu_mode
|
@cpu_mode = config.cpu_mode
|
||||||
|
@disk_bus = config.disk_bus
|
||||||
@nested = config.nested
|
@nested = config.nested
|
||||||
@memory_size = config.memory*1024
|
@memory_size = config.memory*1024
|
||||||
@domain_volume_cache = config.volume_cache
|
@domain_volume_cache = config.volume_cache
|
||||||
|
@ -32,6 +32,7 @@ module VagrantPlugins
|
|||||||
attr_accessor :memory
|
attr_accessor :memory
|
||||||
attr_accessor :cpus
|
attr_accessor :cpus
|
||||||
attr_accessor :cpu_mode
|
attr_accessor :cpu_mode
|
||||||
|
attr_accessor :disk_bus
|
||||||
attr_accessor :nested
|
attr_accessor :nested
|
||||||
attr_accessor :volume_cache
|
attr_accessor :volume_cache
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ module VagrantPlugins
|
|||||||
@memory = UNSET_VALUE
|
@memory = UNSET_VALUE
|
||||||
@cpus = UNSET_VALUE
|
@cpus = UNSET_VALUE
|
||||||
@cpu_mode = UNSET_VALUE
|
@cpu_mode = UNSET_VALUE
|
||||||
|
@disk_bus = UNSET_VALUE
|
||||||
@nested = UNSET_VALUE
|
@nested = UNSET_VALUE
|
||||||
@volume_cache = UNSET_VALUE
|
@volume_cache = UNSET_VALUE
|
||||||
end
|
end
|
||||||
@ -67,6 +69,7 @@ module VagrantPlugins
|
|||||||
@memory = 512 if @memory == UNSET_VALUE
|
@memory = 512 if @memory == UNSET_VALUE
|
||||||
@cpus = 1 if @cpus == UNSET_VALUE
|
@cpus = 1 if @cpus == UNSET_VALUE
|
||||||
@cpu_mode = 'host-model' if @cpu_mode == UNSET_VALUE
|
@cpu_mode = 'host-model' if @cpu_mode == UNSET_VALUE
|
||||||
|
@disk_bus = 'virtio' if @disk_bus == UNSET_VALUE
|
||||||
@nested = false if @nested == UNSET_VALUE
|
@nested = false if @nested == UNSET_VALUE
|
||||||
@volume_cache = 'default' if @volume_cache == UNSET_VALUE
|
@volume_cache = 'default' if @volume_cache == UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>
|
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>
|
||||||
<source file='<%= @domain_volume_path %>'/>
|
<source file='<%= @domain_volume_path %>'/>
|
||||||
<%# we need to ensure a unique target dev -%>
|
<%# we need to ensure a unique target dev -%>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='<%= @disk_bus %>'/>
|
||||||
</disk>
|
</disk>
|
||||||
<serial type='pty'>
|
<serial type='pty'>
|
||||||
<target port='0'/>
|
<target port='0'/>
|
||||||
|
Loading…
Reference in New Issue
Block a user