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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Sep 25 12:25:43 CEST 2019


On September 24, 2019 4:04 pm, Oguz Bektas wrote:
> 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;

why not $conf->{$key} = $lxc_list

?

>  		}
>  		next;
>  	    }
> -- 
> 2.20.1
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list