5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-07 17:17:57 +03:00

api: switch agent api call to 'array' type

we don't want to use the '-alist' formats anymore in favor of real arrays

Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-06-06 15:08:51 +02:00 committed by Wolfgang Bumiller
parent 2e4357c537
commit 1572afe8ed

View File

@ -274,10 +274,12 @@ __PACKAGE__->register_method({
vmid => get_standard_option('pve-vmid', {
completion => \&PVE::QemuServer::complete_vmid_running }),
command => {
type => 'string',
format => 'string-alist',
description => 'The command as a list of program + arguments',
optional => 1,
type => 'array',
description => 'The command as a list of program + arguments.',
items => {
format => 'string',
description => 'A single part of the program + arguments.',
}
},
'input-data' => {
type => 'string',
@ -300,10 +302,7 @@ __PACKAGE__->register_method({
my ($param) = @_;
my $vmid = $param->{vmid};
my $cmd = undef;
if ($param->{command}) {
$cmd = [PVE::Tools::split_list($param->{command})];
}
my $cmd = $param->{command};
my $res = PVE::QemuServer::Agent::qemu_exec($vmid, $param->{'input-data'}, $cmd);
return $res;