[DRE-commits] [vagrant-libvirt] 43/67: Allow changing disk bus
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:56:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.14
in repository vagrant-libvirt.
commit f277c1119cd408ca6a45eb83f74859c1b68f10d9
Author: Brian Pitts <brian at polibyte.com>
Date: Mon Jan 6 11:49:07 2014 -0600
Allow changing disk bus
---
lib/vagrant-libvirt/action/create_domain.rb | 1 +
lib/vagrant-libvirt/config.rb | 3 +++
lib/vagrant-libvirt/templates/domain.xml.erb | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
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 @@
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>
<source file='<%= @domain_volume_path %>'/>
<%# we need to ensure a unique target dev -%>
- <target dev='vda' bus='virtio'/>
+ <target dev='vda' bus='<%= @disk_bus %>'/>
</disk>
<serial type='pty'>
<target port='0'/>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git
More information about the Pkg-ruby-extras-commits
mailing list