[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert()
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert() |
Date: |
Fri, 19 Jun 2015 12:07:03 +0200 |
On Fri, Jun 19, 2015 at 12:00:53PM +0200, Greg Kurz wrote:
> In case NDEBUG is defined, assert() expands to nothing and
> vhost_net_set_vnet_endian() doesn't get called...
>
> Suggested-by: Thomas Huth <address@hidden>
> Signed-off-by: Greg Kurz <address@hidden>
Not sure what the point is.
We don't support building with NDEBUG.
> ---
> hw/net/vhost_net.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Michael,
>
> Yet another fix for the cross-endian vhost series... please
> apply.
>
> --
> Greg
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index f505c91d420a..6d3b7879f8ef 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -376,7 +376,8 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState
> *ncs,
> }
> assert(r >= 0);
>
> - assert(vhost_net_set_vnet_endian(dev, ncs[0].peer, false) >= 0);
> + r = vhost_net_set_vnet_endian(dev, ncs[0].peer, false);
> + assert(r >= 0);
> }
>
> void vhost_net_cleanup(struct vhost_net *net)
- [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Greg Kurz, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(),
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Peter Maydell, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Michael S. Tsirkin, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Markus Armbruster, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Michael S. Tsirkin, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Markus Armbruster, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Michael S. Tsirkin, 2015/06/19
- Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert(), Greg Kurz, 2015/06/19