[pve-devel] [PATCH container] don't duplicate lxc.idmap entries during restore
Oguz Bektas
o.bektas at proxmox.com
Tue Sep 24 16:04:02 CEST 2019
merging $conf->{lxc} causes lxc.idmap entries to be duplicated in the
restored configuration. instead, we can overwrite the contents from the
extracted configuration file. this way we don't duplicate these entries.
(having duplicate idmap entries causes container to crash during start)
Co-developed-by: Stefan Reiter <s.reiter at proxmox.com>
Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
src/PVE/LXC/Create.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index a46a50c..4add540 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -186,7 +186,9 @@ sub restore_configuration {
}
warn "--------------------------------\n";
} else {
- @{$conf->{$key}} = (@$lxc_list, @{$conf->{$key}});
+ # $conf->{lxc} can only have lxc.idmap
+ # so we can overwrite the current $conf from $oldconf
+ @{$conf->{$key}} = @$lxc_list;
}
next;
}
--
2.20.1
More information about the pve-devel
mailing list