]> git.proxmox.com Git - qemu-server.git/commitdiff
add 'passwd' to qm
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 26 Jun 2018 12:15:45 +0000 (14:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 11 Jul 2018 08:29:45 +0000 (10:29 +0200)
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>
PVE/CLI/qm.pm

index cf26943ce3709f1a6d73f57a091658bcc86fc38f..736418c51d2d7e11f9b0d034f21af184d3bd662b 100755 (executable)
@@ -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']],