]> git.proxmox.com Git - qemu-server.git/commitdiff
api: switch agent api call to 'array' type
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 6 Jun 2023 13:08:51 +0000 (15:08 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 7 Jun 2023 11:43:53 +0000 (13:43 +0200)
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>
PVE/API2/Qemu/Agent.pm

index 5ff1fa9d107dfa58403b51bee0dd21c22b152db8..dceee77059e38d8b5520be7a84540c2d2e756d3c 100644 (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;