Merge pull request #491 from giacomolozito/9p_nomount

Option to disable p9 automounting at boot
This commit is contained in:
Dmitry Vasilets 2015-10-26 14:06:18 +01:00
commit 5ed8a2a4f2
2 changed files with 12 additions and 3 deletions

View File

@ -599,6 +599,12 @@ it an setting the type, e.g.
config.vm.synced_folder './', '/vagrant', type: '9p', disabled: false, accessmode: "squash", owner: "vagrant"
or
config.vm.synced_folder './', '/vagrant', type: '9p', disabled: false, accessmode: "mapped", mount: false
For 9p shares, a `mount: false` option allows to define synced folders without mounting them at boot.
**SECURITY NOTE:** for remote libvirt, nfs synced folders requires a bridged public network interface and you must connect to libvirt via ssh.

View File

@ -38,6 +38,7 @@ module VagrantPlugins
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]
@ -63,9 +64,11 @@ module VagrantPlugins
# 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(