]> git.proxmox.com Git - qemu-server.git/commitdiff
add qm listsnapshot call
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 7 Oct 2016 08:51:13 +0000 (10:51 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 19 Oct 2016 09:54:03 +0000 (11:54 +0200)
the api call is already there, just not used in qm.pm
copied mostly from pct.pm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/CLI/qm.pm

index e513f33bb076cc3504aa07b9b5134a89b36fa3aa..a0e0ba564d5bf0bc3bfb6e841687096d0541ac64 100755 (executable)
@@ -490,6 +490,17 @@ our $cmddef = {
 
     delsnapshot => [ "PVE::API2::Qemu", 'delsnapshot', ['vmid', 'snapname'], { node => $nodename } , $upid_exit ],
 
+    listsnapshot => [ "PVE::API2::Qemu", '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);
+                       }
+                   }],
+
     rollback => [ "PVE::API2::Qemu", 'rollback', ['vmid', 'snapname'], { node => $nodename } , $upid_exit ],
 
     template => [ "PVE::API2::Qemu", 'template', ['vmid'], { node => $nodename }],