From a1fd8f3e5f2faeccd08a617c0208dd786cf4a6d7 Mon Sep 17 00:00:00 2001 From: Julia Suvorova Date: Wed, 4 Mar 2020 20:07:54 -0500 Subject: [PATCH 12/12] virtio-net: delete also control queue when TX/RX deleted RH-Author: Julia Suvorova Message-id: <20200304200754.32708-5-jusual@redhat.com> Patchwork-id: 94155 O-Subject: [RHEL-7.9 qemu-kvm-rhev PATCH 4/4] virtio-net: delete also control queue when TX/RX deleted Bugzilla: 1721403 RH-Acked-by: Stefano Garzarella RH-Acked-by: Maxim Levitsky RH-Acked-by: Michael S. Tsirkin From: Yuri Benditovich https://bugzilla.redhat.com/show_bug.cgi?id=1708480 If the control queue is not deleted together with TX/RX, it later will be ignored in freeing cache resources and hot unplug will not be completed. Cc: qemu-stable@nongnu.org Signed-off-by: Yuri Benditovich Message-Id: <20191226043649.14481-3-yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit d945d9f1731244ef341f74ede93120fc9de35913) Signed-off-by: Jon Maloy --- hw/net/virtio-net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 90502fca7c..c4896184ed 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2100,8 +2100,12 @@ static void virtio_net_device_unrealize(DeviceState *dev, Error **errp) virtio_net_del_queue(n, i); } + /* delete also control vq */ + virtio_del_queue(vdev, max_queues * 2); + timer_del(n->announce_timer); timer_free(n->announce_timer); + g_free(n->vqs); qemu_del_nic(n->nic); virtio_cleanup(vdev); -- 2.18.2