]> git.proxmox.com Git - pve-container.git/commitdiff
don't keep old existing config when restoring
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 20 Apr 2016 10:30:42 +0000 (12:30 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 20 Apr 2016 15:50:42 +0000 (17:50 +0200)
this breaks the expected ranking of configuration options
and does not make much sense in any case.

src/PVE/LXC/Create.pm

index 6c2c73543dbc287766ac15d9169912b920c87262..6c47ceb784be0c824dba835226373a1fbec192ff 100644 (file)
@@ -201,24 +201,10 @@ sub create_rootfs {
        
        # destroy old container volume
        PVE::LXC::destroy_lxc_container($storage_cfg, $vmid, $old_conf);
-
-       # do not copy all settings to restored container
-       foreach my $opt (qw(rootfs digest snapshots arch ostype unprivileged parent)) {
-           delete $old_conf->{$opt};
-       }
-       foreach my $opt (keys %$old_conf) {
-           delete $old_conf->{$opt} if $opt =~ m/^mp\d+$/;
-       }
-
-       PVE::LXC::Config->update_pct_config($vmid, $conf, 0, $old_conf);
-
-       PVE::LXC::Config->write_config($vmid, $conf);
-
-    } else {
-       
-       PVE::LXC::Config->write_config($vmid, $conf);
     }
 
+    PVE::LXC::Config->write_config($vmid, $conf);
+
     eval {
        my $rootdir = PVE::LXC::mount_all($vmid, $storage_cfg, $conf);
         restore_and_configure($vmid, $archive, $rootdir, $conf, $password,