qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: qemu-devel@nongnu.org
Cc: aliguori@amazon.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH] virtio-net: remove function calls from assert
Date: Tue, 11 Feb 2014 10:42:02 +1030	[thread overview]
Message-ID: <1392077522-11903-1-git-send-email-joel@jms.id.au> (raw)

peer_{de,at}tach were called from inside assert(). This will be a
problem for virtio-net if built with NDEBUG.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 hw/net/virtio-net.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 3626608..535948d 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -401,12 +401,15 @@ static int peer_detach(VirtIONet *n, int index)
 static void virtio_net_set_queues(VirtIONet *n)
 {
     int i;
+    int r;
 
     for (i = 0; i < n->max_queues; i++) {
         if (i < n->curr_queues) {
-            assert(!peer_attach(n, i));
+            r = peer_attach(n, i);
+            assert(!r);
         } else {
-            assert(!peer_detach(n, i));
+            r = peer_detach(n, i);
+            assert(!r);
         }
     }
 }
-- 
1.9.rc1

             reply	other threads:[~2014-02-11  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  0:12 Joel Stanley [this message]
2014-02-11  5:03 ` [Qemu-devel] [PATCH] virtio-net: remove function calls from assert Michael S. Tsirkin
2014-02-11  5:10   ` Michael S. Tsirkin
2014-02-11  8:01     ` Joel Stanley

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=1392077522-11903-1-git-send-email-joel@jms.id.au \
    --to=joel@jms.id.au \
    --cc=aliguori@amazon.com \
    --cc=mst@redhat.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).