qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Greg Kurz <gkurz@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert()
Date: Fri, 19 Jun 2015 12:07:03 +0200	[thread overview]
Message-ID: <20150619120638-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <20150619095853.12531.15450.stgit@bahia.huguette.org>

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 <thuth@redhat.com>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

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)

  reply	other threads:[~2015-06-19 10:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19 10:00 [Qemu-devel] [PATCH] vhost_net: fix misuse of assert() Greg Kurz
2015-06-19 10:07 ` Michael S. Tsirkin [this message]
2015-06-19 10:13   ` Peter Maydell
2015-06-19 10:15     ` Michael S. Tsirkin
2015-06-19 10:55       ` Markus Armbruster
2015-06-19 13:37         ` Michael S. Tsirkin
2015-06-19 14:00           ` Markus Armbruster
2015-06-19 14:06             ` Michael S. Tsirkin
2015-06-19 14:37               ` Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150619120638-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).