lib/vagrant-libvirt/cap/synced_folder.rb in vagrant-libvirt-0.0.20 vs lib/vagrant-libvirt/cap/synced_folder.rb in vagrant-libvirt-0.0.21
- old
+ new
@@ -42,11 +42,11 @@
begin
# loop through folders
folders.each do |id, folder_opts|
folder_opts.merge!({ :accessmode => "passthrough",
- :readonly => nil })
+ :readonly => nil }) { |_k, ov, _nv| ov }
machine.ui.info "================\nMachine id: #{machine.id}\nShould be mounting folders\n #{id}, opts: #{folder_opts}"
xml = to_xml('filesystem', folder_opts )
# puts "<<<<< XML:\n #{xml}\n >>>>>"
@conn.lookup_domain_by_uuid(machine.id).attach_device(xml, 0)
@@ -65,16 +65,15 @@
machine.ui.info("mounting p9 share in guest")
# Only mount folders that have a guest path specified.
mount_folders = {}
folders.each do |id, opts|
mount_folders[id] = opts.dup if opts[:guestpath]
+ # merge common options if not given
+ mount_folders[id].merge!(:version => '9p2000.L') { |_k, ov, _nv| ov }
end
- common_opts = {
- :version => '9p2000.L',
- }
# Mount the actual folder
machine.guest.capability(
- :mount_p9_shared_folder, mount_folders, common_opts)
+ :mount_p9_shared_folder, mount_folders)
end
def cleanup(machine, _opts)
raise Vagrant::Errors::Error("No libvirt connection") if ProviderLibvirt.libvirt_connection.nil?