X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FCLI%2Fqm.pm;h=f4bacd696121d94e973130ef67f3b2911906575c;hb=b14477e718969468a9a5ef639533b9ff620e84ec;hp=eceb9b3861dc7d0c99ff0c9ca37689a0535935fe;hpb=3ea84aeb7c75d7b0bfbd9cb04440ad00072bfe0c;p=qemu-server.git diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index eceb9b3..f4bacd6 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -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}; @@ -753,6 +761,9 @@ __PACKAGE__->register_method({ my $clean = $param->{'clean-shutdown'}; my $guest = $param->{'guest-requested'}; + # return if we do not have the config anymore + return if !-f PVE::QemuConfig->config_file($vmid); + my $storecfg = PVE::Storage::config(); warn "Starting cleanup for $vmid\n";