[PATCH] revert commit baade4cd2bf partly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is not a memory leak. See line 8029 and 8030 of qemu_driver.c.

To ensure this, I tested twice following these steps:

  1. set bandwidth lively (--live)
  2. query bandwidth (--live)
  3. set bandwidth lively (--live)

The first time libvirtd crashed at step 2. The second time
on step 2 I got strage data, and libvirtd crashed at step 3.

---
 src/qemu/qemu_driver.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e93fe87..4be36f5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7864,7 +7864,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
     virDomainDefPtr persistentDef = NULL;
     int ret = -1;
     virDomainNetDefPtr net = NULL, persistentNet = NULL;
-    virNetDevBandwidthPtr bandwidth = NULL, newBandwidth = NULL;
+    virNetDevBandwidthPtr bandwidth = NULL;
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -7986,6 +7986,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
     }
 
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+        virNetDevBandwidthPtr newBandwidth = NULL;
+
         if (VIR_ALLOC(newBandwidth) < 0) {
             virReportOOMError();
             goto cleanup;
@@ -8053,7 +8055,6 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
     ret = 0;
 cleanup:
     virNetDevBandwidthFree(bandwidth);
-    virNetDevBandwidthFree(newBandwidth);
     virCgroupFree(&group);
     if (vm)
         virDomainObjUnlock(vm);
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]