From 0e4d9f0332efd8417831815a414a5131f85e0a85 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Fri, 3 Jul 2020 12:37:05 -0400 Subject: virtio-net: fix removal of failover device RH-Author: Juan Quintela Message-id: <20200703123705.7175-2-quintela@redhat.com> Patchwork-id: 97901 O-Subject: [RHEL-AV-8.2.1 qemu-kvm PATCH 1/1] virtio-net: fix removal of failover device Bugzilla: 1820120 RH-Acked-by: Stefan Hajnoczi RH-Acked-by: Laurent Vivier RH-Acked-by: Dr. David Alan Gilbert If you have a networking device and its virtio failover device, and you remove them in this order: - virtio device - the real device You get qemu crash. See bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1820120 Bug exist on qemu 4.2 and 5.0. But in 5.0 don't shows because commit 77b06bba62034a87cc61a9c8de1309ae3e527d97 somehow papers over it. CC: Jason Wang CC: Michael S. Tsirkin Signed-off-by: Juan Quintela Signed-off-by: Danilo C. L. de Paula --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 1596cb1..f82455b 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3417,6 +3417,7 @@ static void virtio_net_device_unrealize(DeviceState *dev) g_free(n->vlans); if (n->failover) { + device_listener_unregister(&n->primary_listener); g_free(n->primary_device_id); g_free(n->standby_id); qobject_unref(n->primary_device_dict); -- 1.8.3.1