diff --git a/README.md b/README.md index f02f8a7..b8dfdd1 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ This provider exposes quite a few provider-specific configuration options: ### Domain Specific Options +* `disk_bus` - The type of disk device to emulate. Defaults to virtio if not set. Possible values are documented in libvirt's [description for _target_](http://libvirt.org/formatdomain.html#elementsDisks). * `memory` - Amount of memory in MBytes. Defaults to 512 if not set. * `cpus` - Number of virtual cpus. Defaults to 1 if not set. * `nested` - [Enable nested virtualization](https://github.com/torvalds/linux/blob/master/Documentation/virtual/kvm/nested-vmx.txt). Default is false. @@ -121,7 +122,7 @@ Vagrant.configure("2") do |config| domain.memory = 2048 domain.cpus = 2 domain.nested = true - domain.volume_cache = 'none' + domain.volume_cache = 'none' end end diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb index f714039..21d1707 100644 --- a/lib/vagrant-libvirt/action/create_domain.rb +++ b/lib/vagrant-libvirt/action/create_domain.rb @@ -20,6 +20,7 @@ module VagrantPlugins @name = env[:domain_name] @cpus = config.cpus @cpu_mode = config.cpu_mode + @disk_bus = config.disk_bus @nested = config.nested @memory_size = config.memory*1024 @domain_volume_cache = config.volume_cache diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 4e5f2d7..bd5bbc2 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -32,6 +32,7 @@ module VagrantPlugins attr_accessor :memory attr_accessor :cpus attr_accessor :cpu_mode + attr_accessor :disk_bus attr_accessor :nested attr_accessor :volume_cache @@ -49,6 +50,7 @@ module VagrantPlugins @memory = UNSET_VALUE @cpus = UNSET_VALUE @cpu_mode = UNSET_VALUE + @disk_bus = UNSET_VALUE @nested = UNSET_VALUE @volume_cache = UNSET_VALUE end @@ -67,6 +69,7 @@ module VagrantPlugins @memory = 512 if @memory == UNSET_VALUE @cpus = 1 if @cpus == 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 @volume_cache = 'default' if @volume_cache == UNSET_VALUE end diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 3ad8f4c..8b943e1 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -26,7 +26,7 @@ <%# we need to ensure a unique target dev -%> - +