All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non-zero
@ 2015-12-01 13:32 Victor Kaplansky
  2015-12-02  6:53 ` Jason Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Victor Kaplansky @ 2015-12-01 13:32 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jason Wang, Victor Kaplansky, Michael S. Tsirkin, Changchun Ouyang

Fix QEMU crash when -netdev type=vhost-user,queues=n is passed
with zero number of queues.

Signed-off-by: Victor Kaplansky <victork@redhat.com>
---
 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);
 }
-- 
--Victor

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non-zero
  2015-12-01 13:32 [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non-zero Victor Kaplansky
@ 2015-12-02  6:53 ` Jason Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2015-12-02  6:53 UTC (permalink / raw)
  To: Victor Kaplansky, qemu-devel; +Cc: Michael S. Tsirkin, Changchun Ouyang



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 <victork@redhat.com>
> ---
>  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 <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-02  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 13:32 [Qemu-devel] [PATCH] vhost-user: verify that number of queues is non-zero Victor Kaplansky
2015-12-02  6:53 ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.