add 'passwd' to qm

this adds a command 'qm ga passwd' so that we can reuse
'qm ga' for future guest agent calls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-06-26 14:15:45 +02:00 committed by Thomas Lamprecht
parent b428fb63fa
commit 8593cbe41c

View File

@ -681,9 +681,11 @@ sub param_mapping {
return URI::Escape::uri_escape(PVE::Tools::file_get_contents($_[0]));
}];
my $cipassword_map = PVE::CLIHandler::get_standard_mapping('pve-password', { name => 'cipassword' });
my $password_map = PVE::CLIHandler::get_standard_mapping('pve-password');
my $mapping = {
'update_vm' => [$ssh_key_map, $cipassword_map],
'create_vm' => [$ssh_key_map, $cipassword_map],
'set-user-password' => [$password_map],
};
return $mapping->{$name};
@ -816,6 +818,10 @@ our $cmddef = {
agent => [ "PVE::API2::Qemu::Agent", 'agent', ['vmid', 'command'],
{ node => $nodename }, $print_agent_result ],
ga => {
passwd => [ "PVE::API2::Qemu::Agent", 'set-user-password', [ 'vmid', 'username' ], { node => $nodename }],
},
mtunnel => [ __PACKAGE__, 'mtunnel', []],
nbdstop => [ __PACKAGE__, 'nbdstop', ['vmid']],