qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non-zero
Date: Wed, 2 Dec 2015 14:53:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 12/01/2015 09:32 PM, Victor Kaplansky wrote:
> Fix QEMU crash when -netdev type=vhost-user,queues=n is passed
> with zero number of queues.
>
> Signed-off-by: Victor Kaplansky <address@hidden>
> ---
>  net/vhost-user.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/net/vhost-user.c b/net/vhost-user.c
> index 5071602..b368a90 100644
> --- a/net/vhost-user.c
> +++ b/net/vhost-user.c
> @@ -316,6 +316,11 @@ int net_init_vhost_user(const NetClientOptions *opts, 
> const char *name,
>      }
>  
>      queues = vhost_user_opts->has_queues ? vhost_user_opts->queues : 1;
> +    if (queues < 1) {
> +        error_setg(errp,
> +                   "vhost-user number of queues must be bigger than zero");
> +        return -1;
> +    }
>  
>      return net_vhost_user_init(peer, "vhost_user", name, chr, queues);
>  }

Acked-by: Jason Wang <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]