[pve-devel] applied: [PATCH qemu-server] fix #2697: map netdev_add options to correct json types

Thomas Lamprecht t.lamprecht at proxmox.com
Fri May 8 12:59:19 CEST 2020


On 4/21/20 4:01 PM, Dominik Csapak wrote:
> 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 at proxmox.com>
> ---
> i checked and i found no other parameter or qmp call that needs
> changing, but maybe someone else can also check this, just to be sure
> 
>  PVE/QemuServer.pm | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 37c7320..030e04b 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -4047,6 +4047,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;
>  }
> 

applied thanks!




More information about the pve-devel mailing list