X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FAPI2%2FQemu.pm;h=5d69ca33f194876ff3c78879084855e552929422;hb=d191446898892ad2b89fc41efc34546e6bc07f0d;hp=ba54461d2bde21f68277e748df91048d67337225;hpb=a3222b9184399eb1a7f93f51ad72cf582b7729f4;p=qemu-server.git diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index ba54461d..5d69ca33 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1929,11 +1929,10 @@ __PACKAGE__->register_method({ push @$res, $item; } - if ($conf->{parent}) { - push @$res, { name => '__current', parent => $conf->{parent} }; - } else { - push @$res, { name => '__current' }; - } + my $current = { name => 'current', digest => $conf->{digest} }; + $current->{parent} = $conf->{parent} if $conf->{parent}; + + push @$res, $current; return $res; }}); @@ -1988,6 +1987,9 @@ __PACKAGE__->register_method({ my $snapname = extract_param($param, 'snapname'); + die "unable to use snapshot name 'current' (reserved name)\n" + if $snapname eq 'current'; + my $realcmd = sub { PVE::Cluster::log_msg('info', $authuser, "snapshot VM $vmid: $snapname"); PVE::QemuServer::snapshot_create($vmid, $snapname, $param->{vmstate},