From: Jason Wang Date: Wed, 29 Mar 2017 02:41:23 +0000 (+0800) Subject: virtio-net: avoid call tap_enable when there's only one queue X-Git-Tag: v2.9.0-rc3~19^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=sidebyside;h=1074b879d1c84232177f9b4e044636639ac4c6a5;p=mirror_qemu.git 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 Tested-by: Andrew Baumann Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang --- diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index c32168077a..7d091c9259 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); }