diff options
author | Jason Wang <jasowang@redhat.com> | 2017-03-29 10:41:23 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2017-03-31 08:48:13 +0800 |
commit | 1074b879d1c84232177f9b4e044636639ac4c6a5 (patch) | |
tree | cd01be700d5b463e5472f97070b391a213ca7a6e /hw/net/virtio-net.c | |
parent | ddc2c3a57e0752c0650fdb735a8b8322542d4248 (diff) | |
download | qemu-1074b879d1c84232177f9b4e044636639ac4c6a5.zip qemu-1074b879d1c84232177f9b4e044636639ac4c6a5.tar.gz qemu-1074b879d1c84232177f9b4e044636639ac4c6a5.tar.bz2 |
virtio-net: avoid call tap_enable when there's only one queue
We call tap_enable() even if for multiqueue is not enabled. This is
wrong since it should be used for multiqueue codes to enable a
disabled queue. Fixing this by only calling this when multiqueue is
used.
Fixes: 16dbaf905b72 ("tap: support enabling or disabling a queue")
Reported-by: Andrew Baumann <Andrew.Baumann@microsoft.com>
Tested-by: Andrew Baumann <Andrew.Baumann@microsoft.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
-rw-r--r-- | hw/net/virtio-net.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index c321680..7d091c9 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -510,6 +510,10 @@ static int peer_attach(VirtIONet *n, int index) return 0; } + if (n->max_queues == 1) { + return 0; + } + return tap_enable(nc->peer); } |