lib/vagrant-libvirt/cap/synced_folder.rb in vagrant-libvirt-0.0.32 vs lib/vagrant-libvirt/cap/synced_folder.rb in vagrant-libvirt-0.0.33

- old
+ new

@@ -36,10 +36,11 @@ begin # loop through folders folders.each do |id, folder_opts| folder_opts.merge!({ target: id, accessmode: 'passthrough', + mount: true, readonly: nil }) { |_k, ov, _nv| ov } mount_tag = Digest::MD5.new.update(folder_opts[:hostpath]).to_s[0,31] folder_opts[:mount_tag] = mount_tag @@ -61,12 +62,14 @@ # Go through each folder and mount 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 } + if opts[:mount] && opts[:guestpath] && ! opts[:guestpath].empty? + mount_folders[id] = opts.dup + # merge common options if not given + mount_folders[id].merge!(version: '9p2000.L') { |_k, ov, _nv| ov } + end end # Mount the actual folder machine.guest.capability( :mount_p9_shared_folder, mount_folders) end