Signed-off-by: Tim Marx <t.m...@proxmox.com>
---
 PVE/API2/Qemu.pm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index fd51bf3..0b31f53 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -940,14 +940,20 @@ __PACKAGE__->register_method({
        check => ['perm', '/vms/{vmid}', [ 'VM.Audit' ]],
     },
     parameters => {
-       additionalProperties => 0,
        properties => {
            node => get_standard_option('pve-node'),
            vmid => get_standard_option('pve-vmid', { completion => 
\&PVE::QemuServer::complete_vmid }),
+           object => {
+               description => "In this case the root element is an object 
instead of an array.".
+                              "The key property of the items will be extracted 
and used as the root object keys.",
+               optional => 1,
+               default => 0,
+               type => 'boolean',
+           },
        },
     },
     returns => {
-       type => "array",
+       type => [ "array", "object"],
        items => {
            type => "object",
            properties => {
@@ -985,8 +991,7 @@ __PACKAGE__->register_method({
 
        $conf->{cipassword} = '**********' if defined($conf->{cipassword});
        $conf->{pending}->{cipassword} = '********** ' if 
defined($conf->{pending}->{cipassword});
-
-       return PVE::GuestHelpers::config_with_pending_array($conf, 
$pending_delete_hash);
+       return PVE::GuestHelpers::config_with_pending($conf, 
$pending_delete_hash, $param->{object});
    }});
 
 # POST/PUT {vmid}/config implementation
-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to