diff options
author | Joel Stanley <joel@jms.id.au> | 2014-02-11 10:42:02 +1030 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-03-09 21:09:37 +0200 |
commit | ddfa83ea06680e83643978f6ecf740b60f86f7c2 (patch) | |
tree | d60c44ac2cc0318b65fd9fc07ceb9d9b770a897c /hw/net | |
parent | 6cb46e1e900a05dea1734a6cbe81c0c1ecb2f2cb (diff) | |
download | qemu-ddfa83ea06680e83643978f6ecf740b60f86f7c2.zip qemu-ddfa83ea06680e83643978f6ecf740b60f86f7c2.tar.gz qemu-ddfa83ea06680e83643978f6ecf740b60f86f7c2.tar.bz2 |
virtio-net: remove function calls from assert
peer_{de,at}tach were called from inside assert().
We don't support building without NDEBUG but it's not tidy.
Rearrange to attach peer outside assert calls.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/virtio-net.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3c0342e..fd23c46 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -397,12 +397,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); } } } |