[pve-devel] [PATCH container 3/3] use snapshot_tree guest helper for pct listsnapshot

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Oct 1 17:32:40 CEST 2019


On 10/1/19 9:33 AM, Oguz Bektas wrote:
> adds feature parity between qm/pct 'listsnapshot' w.r.t. showing
> snapshot tree ordered by date.
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  src/PVE/CLI/pct.pm | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/src/PVE/CLI/pct.pm b/src/PVE/CLI/pct.pm
> index 35ad72f..0dd694b 100755
> --- a/src/PVE/CLI/pct.pm
> +++ b/src/PVE/CLI/pct.pm
> @@ -861,16 +861,7 @@ our $cmddef = {
>  
>      delsnapshot => [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 'snapname'], { node => $nodename } , $upid_exit ],
>  
> -    listsnapshot => [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node => $nodename },
> -		      sub {
> -			  my $res = shift;
> -			  foreach my $e (@$res) {
> -			      my $headline = $e->{description} || 'no-description';
> -			      $headline =~ s/\n.*//sg;
> -			      my $parent = $e->{parent} // 'no-parent';
> -			      printf("%-20s %-20s %s\n", $e->{name}, $parent, $headline);
> -			  }
> -		      }],
> +    listsnapshot => [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node => $nodename },\&PVE::GuestHelpers::PVE::GuestHelpers::snapshot_tree ],

missing space after "," and due to my followup a rename to print_snapshot_tree
is required.

>  
>      rollback => [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 'snapname'], { node => $nodename } , $upid_exit ],
>  
> 





More information about the pve-devel mailing list