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 <[email protected]>
---
 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
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to