From 6659f4c687259108ac6b5d064489eaff4550ba44 Mon Sep 17 00:00:00 2001 From: Vil Surkin Date: Tue, 28 Oct 2014 21:31:06 +0200 Subject: [PATCH] added ability to specify bus for additional disks --- README.md | 1 + lib/vagrant-libvirt/config.rb | 2 ++ lib/vagrant-libvirt/templates/domain.xml.erb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83c7fac..5c8966f 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,7 @@ You can create and attach additional disks to a VM via `libvirt.storage :file`. * `device` - Name of the device node the disk image will have in the VM, e.g. *vdb*. If unspecified, the next available device is chosen. * `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*. The following example creates two additional disks. diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 5ccf2de..48995c3 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -131,6 +131,7 @@ module VagrantPlugins :type => 'qcow2', :size => '10G', # matches the fog default :path => nil, + :bus => 'virtio' }.merge(options) #puts "storage(#{storage_type} --- #{options.to_s})" @@ -141,6 +142,7 @@ module VagrantPlugins :type => options[:type], :size => options[:size], :path => options[:path], + :bus => options[:bus] } if storage_type == :file diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index d5e0486..6c3bda8 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -38,7 +38,7 @@ - + <%# this will get auto generated by libvirt
-%>