[pve-devel] [PATCH v2 container] don't duplicate lxc.idmap entries during restore

Oguz Bektas o.bektas at proxmox.com
Wed Sep 25 13:30:27 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..8b2cfc9 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