[pve-devel] [PATCH v2 qemu-server 2/2] fix #2367: do not allow snapshot with name PENDING

Oguz Bektas o.bektas at proxmox.com
Fri Nov 22 13:35:44 CET 2019


hi,

will this get applied?


On Thu, Oct 24, 2019 at 01:53:09PM +0200, Oguz Bektas wrote:
> or any other variant of the word 'pending'.
> 
> note that we can actually allow this snapshot after PVE 7.0, since
> pending section and snapshots will be properly namespaced.
> ([pve:pending] and [snap:$snapname] or similar).
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  PVE/QemuServer.pm | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 8d7994e..3669643 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2773,7 +2773,10 @@ sub write_vm_config {
>      &$cleanup_config($conf->{pending}, 1);
>  
>      foreach my $snapname (keys %{$conf->{snapshots}}) {
> -	die "internal error" if $snapname eq 'pending';
> +	# TODO: we can allow snapshots with name 'pending' after PVE 7.0
> +	# since pending section is namespaced with 'pve:'
> +	# but for now, we should forbid it to avoid confusion in parser
> +	die "internal error: snapshot name '$snapname' is forbidden" if lc($snapname) eq 'pending';
>  	&$cleanup_config($conf->{snapshots}->{$snapname}, undef, $snapname);
>      }
>  
> -- 
> 2.20.1
> 
> 




More information about the pve-devel mailing list