[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vhost-user: return if no net clients found
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH] vhost-user: return if no net clients found |
Date: |
Thu, 01 Sep 2016 11:43:31 +0000 |
Hi
On Thu, Sep 1, 2016 at 2:15 PM Chen Hanxiao <address@hidden> wrote:
> From: Chen Hanxiao <address@hidden>
>
> If we can't find a suitable net client, return directly.
> Or we will got a segmentation fault.
>
> Signed-off-by: Chen Hanxiao <address@hidden>
> ---
> net/vhost-user.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/vhost-user.c b/net/vhost-user.c
> index b0595f8..fb96db7 100644
> --- a/net/vhost-user.c
> +++ b/net/vhost-user.c
> @@ -210,6 +210,9 @@ static void net_vhost_user_event(void *opaque, int
> event)
> MAX_QUEUE_NUM);
> assert(queues < MAX_QUEUE_NUM);
>
> + if (queues < 1)
> + return;
> +
>
qemu coding style has mandatory {} braces.
I don't understand what this patch fixes. even if queues == 0, there is not
reason I can think of it would crash. Could you provide a backtrace?
A qemu-only reproducer would be really useful.
s = DO_UPCAST(VhostUserState, nc, ncs[0]);
> trace_vhost_user_event(s->chr->label, event);
> switch (event) {
> --
> 1.8.3.1
>
>
>
> --
Marc-André Lureau