[pve-devel] [PATCH container] apply_pending: call cleanup_pending between change/delete loops

Dominik Csapak d.csapak at proxmox.com
Thu Feb 6 15:48:20 CET 2020


lgtm, did not break anything obvious, and fixed my problem i reported 
yesterday[0]

Tested-By: Dominik Csapak <d.csapak at proxmox.com>

0: https://pve.proxmox.com/pipermail/pve-devel/2020-February/041548.html

On 2/5/20 3:03 PM, Oguz Bektas wrote:
> instead of calling it while iterating, inbetween the loops is a better
> place in terms of similarity with qemu side (also this should fix the bug that
> dominik found[0])
> 
> [0]: https://pve.proxmox.com/pipermail/pve-devel/2020-February/041573.html
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>   src/PVE/LXC/Config.pm | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 310aba6..e88ba0b 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -1268,7 +1268,6 @@ sub vmconfig_apply_pending {
>       # FIXME: $force deletion is not implemented for CTs
>       foreach my $opt (sort keys %$pending_delete_hash) {
>   	next if $selection && !$selection->{$opt};
> -	$class->cleanup_pending($conf);
>   	eval {
>   	    if ($opt =~ m/^mp(\d+)$/) {
>   		my $mp = $class->parse_ct_mountpoint($conf->{$opt});
> @@ -1289,6 +1288,8 @@ sub vmconfig_apply_pending {
>   	}
>       }
>   
> +    $class->cleanup_pending($conf);
> +
>       foreach my $opt (sort keys %{$conf->{pending}}) { # add/change
>   	next if $opt eq 'delete'; # just to be sure
>   	next if $selection && !$selection->{$opt};
> @@ -1304,7 +1305,6 @@ sub vmconfig_apply_pending {
>   	if (my $err = $@) {
>   	    $add_apply_error->($opt, $err);
>   	} else {
> -	    $class->cleanup_pending($conf);
>   	    $conf->{$opt} = delete $conf->{pending}->{$opt};
>   	}
>       }
> 





More information about the pve-devel mailing list