From 1572afe8ed4f63928e387ae32c677176c8a363aa Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 6 Jun 2023 15:08:51 +0200 Subject: [PATCH] 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 Signed-off-by: Dominik Csapak --- PVE/API2/Qemu/Agent.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/PVE/API2/Qemu/Agent.pm b/PVE/API2/Qemu/Agent.pm index 5ff1fa9d..dceee770 100644 --- a/PVE/API2/Qemu/Agent.pm +++ b/PVE/API2/Qemu/Agent.pm @@ -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;