[pve-devel] [PATCH qemu-server v2 3/7] add 'passwd' to qm

Dominik Csapak d.csapak at proxmox.com
Tue Jun 26 14:15:45 CEST 2018


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 at proxmox.com>
---
 PVE/CLI/qm.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index 42b8f2c..a7aaf93 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -672,9 +672,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};
@@ -807,6 +809,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']],
-- 
2.11.0





More information about the pve-devel mailing list