]> git.proxmox.com Git - pve-container.git/commitdiff
allow to mount iso images
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 26 Oct 2015 11:22:32 +0000 (12:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 26 Oct 2015 11:22:32 +0000 (12:22 +0100)
src/PVE/LXC.pm

index 4b9ace50ce4105b0dfff5d6e733e4173c707ed65..093d4f413e8fe3c2da97417de0c80fd42b331509 100644 (file)
@@ -2060,6 +2060,8 @@ sub mountpoint_mount {
        my ($vtype, undef, undef, undef, undef, $isBase, $format) =
            PVE::Storage::parse_volname($storage_cfg, $volid);
 
+       $format = 'iso' if $vtype eq 'iso'; # allow to handle iso files
+
        if ($format eq 'subvol') {
            if ($mount_path) {
                if ($snapname) {
@@ -2075,7 +2077,7 @@ sub mountpoint_mount {
                }
            }
            return wantarray ? ($path, 0) : $path;
-       } elsif ($format eq 'raw') {
+       } elsif ($format eq 'raw' || $format eq 'iso') {
            my $use_loopdev = 0;
            my @extra_opts;
            if ($scfg->{path}) {
@@ -2087,7 +2089,9 @@ sub mountpoint_mount {
                die "unsupported storage type '$scfg->{type}'\n";
            }
            if ($mount_path) {
-               if ($isBase || defined($snapname)) {
+               if ($format eq 'iso') {
+                   PVE::Tools::run_command(['mount', '-o', 'ro', @extra_opts, $path, $mount_path]);
+               } elsif ($isBase || defined($snapname)) {
                    PVE::Tools::run_command(['mount', '-o', 'ro,noload', @extra_opts, $path, $mount_path]);
                } else {
                    PVE::Tools::run_command(['mount', @extra_opts, $path, $mount_path]);