Merge pull request #422 from grahamhayes/master

Really Limit p9 tag to 31 bytes
This commit is contained in:
Dmitry Vasilets 2015-07-23 08:00:49 +02:00
commit fd4efde95e
3 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,7 @@ module VagrantPlugins
machine.communicate.sudo("mkdir -p #{expanded_guest_path}") machine.communicate.sudo("mkdir -p #{expanded_guest_path}")
# Mount # Mount
mount_tag = Digest::MD5.new.update(name).to_s[0,31] mount_tag = Digest::MD5.new.update(opts[:hostpath]).to_s[0,31]
mount_opts="-o trans=virtio" mount_opts="-o trans=virtio"
mount_opts += ",access=#{opts[:owner]}" if opts[:owner] mount_opts += ",access=#{opts[:owner]}" if opts[:owner]

View File

@ -1,6 +1,7 @@
require 'log4r' require 'log4r'
require 'ostruct' require 'ostruct'
require 'nokogiri' require 'nokogiri'
require "digest/md5"
require 'vagrant/util/subprocess' require 'vagrant/util/subprocess'
require 'vagrant/errors' require 'vagrant/errors'
@ -38,7 +39,12 @@ module VagrantPlugins
folder_opts.merge!({ target: id, folder_opts.merge!({ target: id,
accessmode: 'passthrough', accessmode: 'passthrough',
readonly: nil }) { |_k, ov, _nv| ov } 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
machine.ui.info "================\nMachine id: #{machine.id}\nShould be mounting folders\n #{id}, opts: #{folder_opts}" machine.ui.info "================\nMachine id: #{machine.id}\nShould be mounting folders\n #{id}, opts: #{folder_opts}"
xml = to_xml('filesystem', folder_opts) xml = to_xml('filesystem', folder_opts)
# puts "<<<<< XML:\n #{xml}\n >>>>>" # puts "<<<<< XML:\n #{xml}\n >>>>>"
@conn.lookup_domain_by_uuid(machine.id).attach_device(xml, 0) @conn.lookup_domain_by_uuid(machine.id).attach_device(xml, 0)

View File

@ -1,7 +1,7 @@
<filesystem type='mount' accessmode='<%= accessmode %>'> <filesystem type='mount' accessmode='<%= accessmode %>'>
<driver type='path' wrpolicy='immediate'/> <driver type='path' wrpolicy='immediate'/>
<source dir='<%= hostpath %>'/> <source dir='<%= hostpath %>'/>
<target dir='<%= target %>'/> <target dir='<%= mount_tag %>'/>
<% unless readonly.nil? %> <% unless readonly.nil? %>
<readonly /> <readonly />
<% end %> <% end %>