[PATCH] util: remove unnecessary code to avoid error overwrite

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

 



virCgroupRemove use VIR_ERROR to log the error and won't
change the virLastErr in the thread, so no need do this.

Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx>
---
 src/util/vircgroup.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 0379c2e..a120a15 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1670,13 +1670,8 @@ virCgroupNewMachineSystemd(const char *name,
     }
 
     if (virCgroupAddTask(*group, pidleader) < 0) {
-        virErrorPtr saved = virSaveLastError();
         virCgroupRemove(*group);
         virCgroupFree(group);
-        if (saved) {
-            virSetError(saved);
-            virFreeError(saved);
-        }
     }
 
     ret = 0;
@@ -1728,13 +1723,8 @@ virCgroupNewMachineManual(const char *name,
         goto cleanup;
 
     if (virCgroupAddTask(*group, pidleader) < 0) {
-        virErrorPtr saved = virSaveLastError();
         virCgroupRemove(*group);
         virCgroupFree(group);
-        if (saved) {
-            virSetError(saved);
-            virFreeError(saved);
-        }
     }
 
  done:
-- 
1.8.3.1

--
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]