]> git.proxmox.com Git - pve-container.git/commitdiff
drop mkdirs flag on mount_all
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Sep 2015 09:12:52 +0000 (11:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 16 Sep 2015 09:48:34 +0000 (11:48 +0200)
It was only used in update_pct_config and isn't required
as mountpoint_mount already creates the directory anyway.

src/PVE/LXC.pm

index 01d031dd9d4c4789ea26327ac5d4be7a39c3ced8..fc1500c7c6b7c4ac1d9abcec0bf869d230e84922 100644 (file)
@@ -1096,7 +1096,7 @@ sub update_pct_config {
 
     my @nohotplug;
 
-    my $new_disks = [];
+    my $new_disks = 0;
 
     my $rootdir;
     if ($running) {
@@ -1201,7 +1201,7 @@ sub update_pct_config {
            $conf->{$opt} = $value ? 1 : 0;
         } elsif ($opt =~ m/^mp(\d+)$/) {
            $conf->{$opt} = $value;
-           push @$new_disks, $opt;
+           $new_disks = 1;
            push @nohotplug, $opt;
            next;
         } elsif ($opt eq 'rootfs') {
@@ -1216,11 +1216,9 @@ sub update_pct_config {
        die "unable to modify " . join(',', @nohotplug) . " while container is running\n";
     }
 
-    if (@$new_disks) {
+    if ($new_disks) {
        my $storage_cfg = PVE::Storage::config();
        create_disks($storage_cfg, $vmid, $conf, $conf);
-       mount_all($vmid, $storage_cfg, $conf, $new_disks, 1);
-       umount_all($vmid, $storage_cfg, $conf, 0);
     }
 }
 
@@ -1901,7 +1899,7 @@ sub umount_all {
 }
 
 sub mount_all {
-    my ($vmid, $storage_cfg, $conf, $mkdirs) = @_;
+    my ($vmid, $storage_cfg, $conf) = @_;
 
     my $rootdir = "/var/lib/lxc/$vmid/rootfs";
     File::Path::make_path($rootdir);
@@ -1924,7 +1922,6 @@ sub mount_all {
 
            die "unable to mount base volume - internal error" if $isBase;
 
-           File::Path::make_path "$rootdir/$mount" if $mkdirs;
            mountpoint_mount($mountpoint, $rootdir, $storage_cfg);
         });
     };