[PATCH] cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively

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

 



ENOENT happens normally when a subsystem is enabled with any other
subsystems and the directory of the target group has already removed
in a prior loop. In that case, the function should just return without
leaving an error message.

NB this is the same behavior as before introducing virCgroupRemoveRecursively.
---
 src/util/cgroup.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index 62b1446..9fa64dc 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -616,6 +616,8 @@ static int virCgroupRemoveRecursively(char *grppath)
 
     grpdir = opendir(grppath);
     if (grpdir == NULL) {
+        if (errno == ENOENT)
+            return 0;
         VIR_ERROR(_("Unable to open %s (%d)"), grppath, errno);
         rc = -errno;
         return rc;
-- 
1.6.5.2

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