From 0ea6bc6943849bbe69f628d62db88305c5b891f0 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 11 Sep 2012 08:33:20 +0200 Subject: [PATCH] snapshot list: include current position --- PVE/API2/Qemu.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index e76d9aa0..a928c4cd 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1918,7 +1918,16 @@ __PACKAGE__->register_method({ my $res = []; foreach my $name (keys %$snaphash) { - push @$res, { name => $name }; + my $d = $snaphash->{$name}; + my $item = { name => $name, description => $d->{description} }; + $item->{parent} = $d->{parent} if $d->{parent}; + push @$res, $item; + } + + if ($conf->{parent}) { + push @$res, { name => '__current', parent => $conf->{parent} }; + } else { + push @$res, { name => '__current' }; } return $res;