[DRE-commits] [vagrant-libvirt] 35/163: Fix mount option handling for 9p
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Apr 24 13:57:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag 0.0.26
in repository vagrant-libvirt.
commit 8f1b0d183a396a83e259763b2a143831529d6f29
Author: Thomas Bechtold <tbechtold at suse.com>
Date: Mon Sep 8 21:22:35 2014 +0200
Fix mount option handling for 9p
Use given mount options and allow to override default options.
---
lib/vagrant-libvirt/cap/mount_p9.rb | 8 ++++----
lib/vagrant-libvirt/cap/synced_folder.rb | 7 +++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/lib/vagrant-libvirt/cap/mount_p9.rb b/lib/vagrant-libvirt/cap/mount_p9.rb
index 38545bd..274edb1 100644
--- a/lib/vagrant-libvirt/cap/mount_p9.rb
+++ b/lib/vagrant-libvirt/cap/mount_p9.rb
@@ -6,7 +6,7 @@ module VagrantPlugins
class MountP9
extend Vagrant::Util::Retryable
- def self.mount_p9_shared_folder(machine, folders, options)
+ def self.mount_p9_shared_folder(machine, folders)
folders.each do |name, opts|
# Expand the guest path so we can handle things like "~/vagrant"
expanded_guest_path = machine.guest.capability(
@@ -19,9 +19,9 @@ module VagrantPlugins
mount_tag = name.dup
mount_opts="-o trans=virtio"
- mount_opts += ",access=#{options[:owner]}" if options[:owner]
- mount_opts += ",version=#{options[:version]}" if options[:version]
- mount_opts += ",#{opts[:mount_options]}" if opts[:mount_options]
+ mount_opts += ",access=#{opts[:owner]}" if opts[:owner]
+ mount_opts += ",version=#{opts[:version]}" if opts[:version]
+ mount_opts += ",#{opts[:mount_opts]}" if opts[:mount_opts]
mount_command = "mount -t 9p #{mount_opts} '#{mount_tag}' #{expanded_guest_path}"
retryable(:on => Vagrant::Errors::LinuxMountFailed,
diff --git a/lib/vagrant-libvirt/cap/synced_folder.rb b/lib/vagrant-libvirt/cap/synced_folder.rb
index b886617..90e7133 100644
--- a/lib/vagrant-libvirt/cap/synced_folder.rb
+++ b/lib/vagrant-libvirt/cap/synced_folder.rb
@@ -67,13 +67,12 @@ module VagrantPlugins
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)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git
More information about the Pkg-ruby-extras-commits
mailing list