api: catch 'pending' as snapshot name early

instead of only at write_config time.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2019-11-25 10:02:46 +01:00
parent 15c6e277a4
commit a85c6be13e

View File

@ -3715,6 +3715,9 @@ __PACKAGE__->register_method({
die "unable to use snapshot name 'current' (reserved name)\n"
if $snapname eq 'current';
die "unable to use snapshot name 'pending' (reserved name)\n"
if lc($snapname) eq 'pending';
my $realcmd = sub {
PVE::Cluster::log_msg('info', $authuser, "snapshot VM $vmid: $snapname");
PVE::QemuConfig->snapshot_create($vmid, $snapname, $param->{vmstate},