]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC.pm
Fix #918: add /dev/mapper symlinks for dm-* devices
[pve-container.git] / src / PVE / LXC.pm
index 3ed5d92fd5ecaf4acc44a32c8cd2ee1905dcaf7f..3a92f3de06f07ff9a19add1d617a90da00a0b001 100644 (file)
@@ -1073,6 +1073,11 @@ sub mountpoint_mount {
            }
            return wantarray ? ($path, 0, undef) : $path;
        } elsif ($format eq 'raw' || $format eq 'iso') {
+           # NOTE: 'mount' performs canonicalization without the '-c' switch, which for
+           # device-mapper devices is special-cased to use the /dev/mapper symlinks.
+           # Our autodev hook expects the /dev/dm-* device currently
+           # and will create the /dev/mapper symlink accordingly
+           ($path) = (Cwd::realpath($path) =~ /^(.*)$/s); # realpath() taints
            my $domount = sub {
                my ($path) = @_;
                if ($mount_path) {