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

[libvirt] [PATCH 1/5] Rename virCgroupGetAppRoot to virCgroupForSelf



From: "Daniel P. Berrange" <berrange redhat com>

The virCgroupGetAppRoot is not clear in its meaning. Change
to virCgroupForSelf to highlight that this returns the
cgroup config for the caller's process

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 src/libvirt_private.syms | 2 +-
 src/lxc/lxc_cgroup.c     | 2 +-
 src/util/vircgroup.c     | 9 ++++++---
 src/util/vircgroup.h     | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 21bc615..f75d681 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1090,9 +1090,9 @@ virCgroupDenyDevicePath;
 virCgroupForDomain;
 virCgroupForDriver;
 virCgroupForEmulator;
+virCgroupForSelf;
 virCgroupForVcpu;
 virCgroupFree;
-virCgroupGetAppRoot;
 virCgroupGetBlkioWeight;
 virCgroupGetCpuacctPercpuUsage;
 virCgroupGetCpuacctStat;
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index df468da..33c305a 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -293,7 +293,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
     int ret;
     virCgroupPtr cgroup;
 
-    ret = virCgroupGetAppRoot(&cgroup);
+    ret = virCgroupForSelf(&cgroup);
     if (ret < 0) {
         virReportSystemError(-ret, "%s",
                              _("Unable to get cgroup for container"));
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 6998f13..266cecb 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -967,19 +967,22 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
 #endif
 
 /**
-* virCgroupGetAppRoot:
+* virCgroupForSelf:
 *
 * @group: Pointer to returned virCgroupPtr
 *
+* Obtain a cgroup representing the config of the
+* current process
+*
 * Returns 0 on success
 */
 #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
-int virCgroupGetAppRoot(virCgroupPtr *group)
+int virCgroupForSelf(virCgroupPtr *group)
 {
     return virCgroupNew("/", group);
 }
 #else
-int virCgroupGetAppRoot(virCgroupPtr *group ATTRIBUTE_UNUSED)
+int virCgroupForSelf(virCgroupPtr *group ATTRIBUTE_UNUSED)
 {
     return -ENXIO;
 }
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index ea42fa2..45a2006 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -49,7 +49,7 @@ int virCgroupForDriver(const char *name,
                        bool privileged,
                        bool create);
 
-int virCgroupGetAppRoot(virCgroupPtr *group);
+int virCgroupForSelf(virCgroupPtr *group);
 
 int virCgroupForDomain(virCgroupPtr driver,
                        const char *name,
-- 
1.8.1.4


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