]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/CLI/qm.pm
Fix #1924: add snapshot parameter
[qemu-server.git] / PVE / CLI / qm.pm
index 26d4217d07e77fc49399502135f8310a83ba5155..f4bacd696121d94e973130ef67f3b2911906575c 100755 (executable)
@@ -127,7 +127,15 @@ __PACKAGE__->register_method ({
                type => 'boolean',
                optional => 1,
                default => 0,
-           }
+           },
+           snapshot => get_standard_option('pve-snapshot-name', {
+               description => "Fetch config values from given snapshot.",
+               optional => 1,
+               completion => sub {
+                   my ($cmd, $pname, $cur, $args) = @_;
+                   PVE::QemuConfig->snapshot_list($args->[0]);
+               }
+           }),
        },
     },
     returns => { type => 'null'},
@@ -135,7 +143,7 @@ __PACKAGE__->register_method ({
        my ($param) = @_;
 
        my $storecfg = PVE::Storage::config();
-       my $cmdline = PVE::QemuServer::vm_commandline($storecfg, $param->{vmid});
+       my $cmdline = PVE::QemuServer::vm_commandline($storecfg, $param->{vmid}, $param->{snapshot});
 
        $cmdline =~ s/ -/ \\\n  -/g if $param->{pretty};