vagrant-parallels 2.3.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45a092a3894860152f2315793cb2a6ca541bc3488b168e3e08c9ba9637f8c867
4
- data.tar.gz: 7e6a76e6734bad9691232004722d0cc04f5bc53992798bd6e5074341dce985af
3
+ metadata.gz: 340fd7bc7a4c4903ee2f67a21435abbd27d0fd3ae531e6e2f45b78d6d40749c6
4
+ data.tar.gz: ec86770f0a873be4d766e53df5a2ebbae3982924be8ee7974107cdd763a7da55
5
5
  SHA512:
6
- metadata.gz: 5ff72d8b55fde7f2d4444048fe9c736e0f312c61f8b5098b0ac5569a1b3415a6c6671b9c54375190cbcd43aebf55b74fbde681ae9ff2c77f0144bd199a525b60
7
- data.tar.gz: 5181b7a0c84d03f593e7e4102e8289c95c292a5328566802f017851617259911012745707b78799bf113bd96e78200f95a6762abbb85135181883c273439dd6b
6
+ metadata.gz: fa1430cfa50873ac14648f6d1c8269812850be959ada747366a669ca7003fbde48460b4e145ef4d193cbfe6ef47cff52bf0db20ea05b2a4fc768e914f9e1cbdc
7
+ data.tar.gz: '07178f61772a66d419117fa8bbabf953aa4d82b76e47952bba691d6b9ef38ceea92561314df94b3f13dd9712a701a2feb5480b80604785e048650be75ae212b9'
data/CHANGELOG.md CHANGED
@@ -1,10 +1,19 @@
1
- ## 2.3.1 (March 23, 2022)
1
+ ## 2.4.0 (May 22, 2023)
2
+ IMPROVEMENTS:
3
+ - Implement shared folder support for `.macvm` VMs
4
+ [[GH-448](https://github.com/Parallels/vagrant-parallels/pull/448)]
5
+
6
+ BUG FIXES:
7
+ - Fix shared folder mount error on `.macvm` VMs
8
+ [[GH-445](https://github.com/Parallels/vagrant-parallels/pull/445)]
9
+
10
+ ## 2.3.1 (March 23, 2023)
2
11
  BUG FIXES:
3
12
  - Fix the detection of VM IP. Wait for the IP to become available to
4
13
  avoid connection issues and Vagrant warnings.
5
14
  [[GH-440](https://github.com/Parallels/vagrant-parallels/issues/440)]
6
15
 
7
- ## 2.3.0 (March 22, 2022)
16
+ ## 2.3.0 (March 22, 2023)
8
17
  IMPROVEMENTS:
9
18
  - Support fetching the VM IP using prlctl
10
19
  [[GH-434](https://github.com/Parallels/vagrant-parallels/pull/434)].
@@ -4,7 +4,6 @@ module VagrantPlugins
4
4
  module Parallels
5
5
  module Action
6
6
  class Import
7
- include VagrantPlugins::Parallels::Util::Common
8
7
  @@lock = Mutex.new
9
8
 
10
9
  def initialize(app, env)
@@ -26,7 +25,7 @@ module VagrantPlugins
26
25
 
27
26
  # Linked clones are supported only for PD 11 and higher
28
27
  # Linked clones are not supported in macvms
29
- if env[:machine].provider_config.linked_clone and !is_macvm(env)
28
+ if env[:machine].provider_config.linked_clone and !Util::Common::is_macvm(env[:machine])
30
29
  # Linked clone creation should not be concurrent [GH-206]
31
30
  options[:snapshot_id] = env[:clone_snapshot_id]
32
31
  options[:linked] = true
@@ -6,7 +6,6 @@ module VagrantPlugins
6
6
  module Parallels
7
7
  module Action
8
8
  class PrepareCloneSnapshot
9
- include VagrantPlugins::Parallels::Util::Common
10
9
  @@lock = Mutex.new
11
10
 
12
11
  def initialize(app, env)
@@ -20,7 +19,7 @@ module VagrantPlugins
20
19
  return @app.call(env)
21
20
  end
22
21
 
23
- if is_macvm(env)
22
+ if Util::Common::is_macvm(env[:machine])
24
23
  #Ignore, since macvms doesn't support snapshot creation
25
24
  @logger.info('Snapshot creation is not supported yet for macOS ARM Guests, skip snapshot preparing')
26
25
  return @app.call(env)
@@ -4,7 +4,6 @@ module VagrantPlugins
4
4
  module Parallels
5
5
  module Action
6
6
  class SaneDefaults
7
- include VagrantPlugins::Parallels::Util::Common
8
7
 
9
8
  def initialize(app, env)
10
9
  @logger = Log4r::Logger.new('vagrant_parallels::action::sanedefaults')
@@ -30,7 +29,7 @@ module VagrantPlugins
30
29
 
31
30
  def default_settings
32
31
  # Options defined below are not supported for `*.macvm` VMs
33
- return {} if is_macvm(@env)
32
+ return {} if Util::Common::is_macvm(@env[:machine])
34
33
 
35
34
  {
36
35
  tools_autoupdate: 'no',
@@ -103,6 +103,16 @@ module VagrantPlugins
103
103
  SyncedFolder
104
104
  end
105
105
 
106
+ synced_folder(:parallels_macvm) do
107
+ require_relative 'synced_folder_macvm'
108
+ SyncedFolderMacVM
109
+ end
110
+
111
+ synced_folder_capability(:parallels_macvm, "mount_name") do
112
+ require_relative "cap/mount_options"
113
+ SyncedFolderCap::MountOptions
114
+ end
115
+
106
116
  synced_folder_capability(:parallels, "mount_name") do
107
117
  require_relative "cap/mount_options"
108
118
  SyncedFolderCap::MountOptions
@@ -4,9 +4,10 @@ module VagrantPlugins
4
4
  module Parallels
5
5
  class SyncedFolder < Vagrant.plugin('2', :synced_folder)
6
6
  def usable?(machine, raise_errors=false)
7
- # These synced folders only work if the provider is Parallels
7
+ # These synced folders only work if the provider is Parallels and the guest is not *.macvm
8
8
  machine.provider_name == :parallels &&
9
- machine.provider_config.functional_psf
9
+ machine.provider_config.functional_psf &&
10
+ !Util::Common::is_macvm(machine)
10
11
  end
11
12
 
12
13
  def prepare(machine, folders, _opts)
@@ -0,0 +1,50 @@
1
+ require 'vagrant/util/platform'
2
+
3
+ module VagrantPlugins
4
+ module Parallels
5
+ class SyncedFolderMacVM < Vagrant.plugin('2', :synced_folder)
6
+ def usable?(machine, raise_errors=false)
7
+ # These synced folders only work if the provider is Parallels and the guest is *.macvm
8
+ machine.provider_name == :parallels && Util::Common::is_macvm(machine)
9
+ end
10
+
11
+ def prepare(machine, folders, _opts)
12
+ # Setup shared folder definitions in the VM config.
13
+ defs = []
14
+ folders.each do |id, data|
15
+ hostpath = data[:hostpath]
16
+ if !data[:hostpath_exact]
17
+ hostpath = Vagrant::Util::Platform.cygwin_windows_path(hostpath)
18
+ end
19
+
20
+ defs << {
21
+ name: data[:plugin].capability(:mount_name, id, data),
22
+ hostpath: hostpath.to_s,
23
+ }
24
+ end
25
+
26
+ driver(machine).share_folders(defs)
27
+ end
28
+
29
+ def enable(machine, folders, _opts)
30
+ # TBD: Synced folders for *.macvm are not implemented yet
31
+ return
32
+ end
33
+
34
+ def disable(machine, folders, _opts)
35
+ # Remove the shared folders from the VM metadata
36
+ names = folders.map { |id, data| data[:plugin].capability(:mount_name, id, data) }
37
+ driver(machine).unshare_folders(names)
38
+ end
39
+
40
+ def cleanup(machine, opts)
41
+ driver(machine).clear_shared_folders if machine.id && machine.id != ''
42
+ end
43
+
44
+ # This is here so that we can stub it for tests
45
+ def driver(machine)
46
+ machine.provider.driver
47
+ end
48
+ end
49
+ end
50
+ end
@@ -5,8 +5,8 @@ module VagrantPlugins
5
5
 
6
6
  # Determines whether the VM's box contains a macOS guest for an Apple Silicon host.
7
7
  # In this case the image file ends with '.macvm' instead of '.pvm'
8
- def is_macvm(env)
9
- return !!Dir.glob(env[:machine].box.directory.join('*.macvm')).first
8
+ def self.is_macvm(machine)
9
+ return !!Dir.glob(machine.box.directory.join('*.macvm')).first
10
10
  end
11
11
 
12
12
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Parallels
3
- VERSION = '2.3.1'
3
+ VERSION = '2.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-parallels
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Zholobov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-23 00:00:00.000000000 Z
12
+ date: 2023-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -142,6 +142,7 @@ files:
142
142
  - lib/vagrant-parallels/plugin.rb
143
143
  - lib/vagrant-parallels/provider.rb
144
144
  - lib/vagrant-parallels/synced_folder.rb
145
+ - lib/vagrant-parallels/synced_folder_macvm.rb
145
146
  - lib/vagrant-parallels/util/common.rb
146
147
  - lib/vagrant-parallels/util/compile_forwarded_ports.rb
147
148
  - lib/vagrant-parallels/util/unix_mount_helpers.rb