this conflicts with our syntax of pending changes, so we have to forbid it
the check must be case-insensitive since we parse it that way from the config

this may be reverted again sometime with 7.0 if we decide to change the
name of the pending section

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 PVE/API2/Qemu.pm  | 3 +++
 PVE/QemuServer.pm | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 9db8967..9a73d04 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -3683,6 +3683,9 @@ __PACKAGE__->register_method({
        die "unable to use snapshot name 'current' (reserved name)\n"
            if $snapname eq 'current';
 
+       die "unable to use snapshot name '$snapname' (reserved name)\n"
+           if $snapname =~ m/^pending$/i;
+
        my $realcmd = sub {
            PVE::Cluster::log_msg('info', $authuser, "snapshot VM $vmid: 
$snapname");
            PVE::QemuConfig->snapshot_create($vmid, $snapname, 
$param->{vmstate},
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 7128723..5295c22 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2834,7 +2834,7 @@ sub write_vm_config {
     &$cleanup_config($conf->{pending}, 1);
 
     foreach my $snapname (keys %{$conf->{snapshots}}) {
-       die "internal error" if $snapname eq 'pending';
+       die "internal error" if $snapname =~ m/^pending$/i;
        &$cleanup_config($conf->{snapshots}->{$snapname}, undef, $snapname);
     }
 
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to