]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2697: map netdev_add options to correct json types
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 21 Apr 2020 14:01:11 +0000 (16:01 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 8 May 2020 10:55:32 +0000 (12:55 +0200)
netdev_add is now a proper qmp command, which means that it verifies
the parameter types properly

instead of sending strings, we now have to choose the correct
types for the parameters

bool for vhost
and uint64 for queues

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/QemuServer.pm

index 6461da35cb3d050d99585c7bf3089f1e709cd9e1..dcf05df32bc66bd311d87051d1dc941515cbafd5 100644 (file)
@@ -4065,6 +4065,14 @@ sub qemu_netdevadd {
     my $netdev = print_netdev_full($vmid, $conf, $arch, $device, $deviceid, 1);
     my %options =  split(/[=,]/, $netdev);
 
+    if (defined(my $vhost = $options{vhost})) {
+       $options{vhost} = JSON::boolean(PVE::JSONSchema::parse_boolean($vhost));
+    }
+
+    if (defined(my $queues = $options{queues})) {
+       $options{queues} = $queues + 0;
+    }
+
     mon_cmd($vmid, "netdev_add",  %options);
     return 1;
 }