Skip to content

Commit

Permalink
B # 3190 Fix LXD unmap symlink issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dann1 committed Apr 5, 2019
1 parent f51b4fc commit c933c8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ def unmap(one_vm, disk, directory)
device = ''

real_path = directory
real_path = File.realpath(directory) if File.symlink?(one_vm.sysds_path)

is_rootfs = real_path.match?(%r{containers(/)one-(\d+)(/)rootfs})
is_shared_ds = File.symlink?(one_vm.sysds_path)

real_path = File.realpath(directory) if !is_rootfs && is_shared_ds

sys_parts.each {|d|
if d['mountpoint'] == real_path
Expand Down

0 comments on commit c933c8a

Please sign in to comment.