X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPVE%2FLXC.pm;h=0365996388486ac76c14debe8b074567d5189588;hb=c9bc95a1d58dc7ff3d752cdd49b056913382f5c7;hp=3ed5d92fd5ecaf4acc44a32c8cd2ee1905dcaf7f;hpb=c019c56af58d74f20c9a0674ec3a858d352d3b9a;p=pve-container.git diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 3ed5d92..0365996 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -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) { @@ -1105,7 +1110,7 @@ sub mountpoint_mount { die "unsupported image format '$format'\n"; } } elsif ($type eq 'device') { - push @extra_opts, '-o', 'ro' if $readonly; + push @extra_opts, '-o', 'ro' if $readonly; PVE::Tools::run_command(['mount', @extra_opts, $volid, $mount_path]) if $mount_path; return wantarray ? ($volid, 0, $volid) : $volid; } elsif ($type eq 'bind') {