diff --git a/README.md b/README.md index 5c8966f..9abb5e0 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,7 @@ You can create and attach additional disks to a VM via `libvirt.storage :file`. * `size` - Size of the disk image. If unspecified, defaults to 10G. * `type` - Type of disk image to create. Defaults to *qcow2*. * `bus` - Type of bus to connect device to. Defaults to *virtio*. +* `cache` - Cache mode to use, e.g. `none`, `writeback`, `writethrough` (see the [libvirt documentation for possible values](http://libvirt.org/formatdomain.html#elementsDisks) or [here](https://www.suse.com/documentation/sles11/book_kvm/data/sect1_chapter_book_kvm.html) for a fuller explanation). Defaults to *default*. The following example creates two additional disks. diff --git a/lib/vagrant-libvirt.rb b/lib/vagrant-libvirt.rb index c7204d9..825e5fa 100644 --- a/lib/vagrant-libvirt.rb +++ b/lib/vagrant-libvirt.rb @@ -27,13 +27,3 @@ module VagrantPlugins end end end - -# set provider by bash env -# export VAGRANT_DEFAULT_PROVIDER=libvirt -Vagrant::Environment.class_eval do - def default_provider - (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym - end -end - - diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 48995c3..3186309 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -142,7 +142,8 @@ module VagrantPlugins :type => options[:type], :size => options[:size], :path => options[:path], - :bus => options[:bus] + :bus => options[:bus], + :cache => options[:cache] || 'default', } if storage_type == :file diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 6c3bda8..1db5894 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -36,7 +36,7 @@ <%# additional disks -%> <% @disks.each do |d| -%> - + <%# this will get auto generated by libvirt diff --git a/vagrant-libvirt.gemspec b/vagrant-libvirt.gemspec index 8c19f9c..e72b53b 100644 --- a/vagrant-libvirt.gemspec +++ b/vagrant-libvirt.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |gem| gem.add_development_dependency "rspec-mocks", "~> 2.12.1" gem.add_runtime_dependency 'fog', '~> 1.15' - gem.add_runtime_dependency 'ruby-libvirt', '~> 0.4.0' + gem.add_runtime_dependency 'ruby-libvirt', '~> 0.4' gem.add_runtime_dependency 'nokogiri', '~> 1.6.0' gem.add_development_dependency 'rake'