mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Merge pull request #422 from grahamhayes/master
Really Limit p9 tag to 31 bytes
This commit is contained in:
commit
fd4efde95e
@ -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]
|
||||||
|
@ -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)
|
||||||
|
@ -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 %>
|
||||||
|
Loading…
Reference in New Issue
Block a user