cryptospore / rpms / qemu-kvm

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