From bf5aef9be3d10fb0cb44025d30ca50fc6b14f0e8 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 21 Apr 2020 16:01:11 +0200 Subject: [PATCH] fix #2697: map netdev_add options to correct json types 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 --- PVE/QemuServer.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6461da3..dcf05df 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -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; } -- 2.39.2