[pve-devel] [PATCH qemu-server] add qm listsnapshot call

Dominik Csapak d.csapak at proxmox.com
Fri Oct 7 10:51:13 CEST 2016


the api call is already there, just not used in qm.pm
copied mostly from pct.pm

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/CLI/qm.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index e513f33..a0e0ba5 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -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 }],
-- 
2.1.4





More information about the pve-devel mailing list