[pve-devel] [PATCH v2 container 1/3] don't keep old existing config when restoring
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Apr 20 12:30:42 CEST 2016
this breaks the expected ranking of configuration options
and does not make much sense in any case.
---
src/PVE/LXC/Create.pm | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 6c2c735..6c47ceb 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -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,
--
2.1.4
More information about the pve-devel
mailing list