yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-pci-Always-delete-and-free-the-release_timer.patch

ae23c9
From 586c02abcca49fceeca0d6f1b4e5cab30dd9a123 Mon Sep 17 00:00:00 2001
ae23c9
From: Cornelia Huck <cohuck@redhat.com>
ae23c9
Date: Wed, 17 Apr 2019 13:57:29 +0100
ae23c9
Subject: [PATCH 12/24] s390x/pci: Always delete and free the release_timer
ae23c9
ae23c9
RH-Author: Cornelia Huck <cohuck@redhat.com>
ae23c9
Message-id: <20190417135741.25297-13-cohuck@redhat.com>
ae23c9
Patchwork-id: 85795
ae23c9
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 12/24] s390x/pci: Always delete and free the release_timer
ae23c9
Bugzilla: 1699070
ae23c9
RH-Acked-by: David Hildenbrand <david@redhat.com>
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
ae23c9
ae23c9
From: David Hildenbrand <david@redhat.com>
ae23c9
ae23c9
We should always get rid of it. I don't see a reason to keep the timer
ae23c9
alive if the devices are going away. This looks like a memory leak.
ae23c9
ae23c9
(hmp) device_add virtio-mouse-pci,id=test
ae23c9
(hmp) device_del test
ae23c9
-> guest notified, timer pending.
ae23c9
-> guest does not react for some reason (e.g. crash)
ae23c9
-> s390_pcihost_timer_cb(). Timer not pending anymore. qmp_unplug().
ae23c9
ae23c9
-> Device deleted. Timer expired (not pending) but not freed.
ae23c9
ae23c9
Signed-off-by: David Hildenbrand <david@redhat.com>
ae23c9
Message-Id: <20190114103110.10909-4-david@redhat.com>
ae23c9
Reviewed-by: Collin Walling <walling@linux.ibm.com>
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
(cherry picked from commit d648a3e62d5e726526f9df283341999792f4fbf9)
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 hw/s390x/s390-pci-bus.c | 2 +-
ae23c9
 1 file changed, 1 insertion(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
ae23c9
index a785acb..ea0c74c 100644
ae23c9
--- a/hw/s390x/s390-pci-bus.c
ae23c9
+++ b/hw/s390x/s390-pci-bus.c
ae23c9
@@ -982,7 +982,7 @@ static void s390_pcihost_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,
ae23c9
         return;
ae23c9
     }
ae23c9
 
ae23c9
-    if (pbdev->release_timer && timer_pending(pbdev->release_timer)) {
ae23c9
+    if (pbdev->release_timer) {
ae23c9
         timer_del(pbdev->release_timer);
ae23c9
         timer_free(pbdev->release_timer);
ae23c9
         pbdev->release_timer = NULL;
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9