Rename virCgroupGetAppRoot to virCgroupForSelf

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>
This commit is contained in:
Daniel P. Berrange 2013-03-21 11:53:14 +00:00
parent b1d3154a50
commit 804a809a06
4 changed files with 9 additions and 6 deletions

View File

@ -1096,9 +1096,9 @@ virCgroupDenyDevicePath;
virCgroupForDomain; virCgroupForDomain;
virCgroupForDriver; virCgroupForDriver;
virCgroupForEmulator; virCgroupForEmulator;
virCgroupForSelf;
virCgroupForVcpu; virCgroupForVcpu;
virCgroupFree; virCgroupFree;
virCgroupGetAppRoot;
virCgroupGetBlkioWeight; virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage; virCgroupGetCpuacctPercpuUsage;
virCgroupGetCpuacctStat; virCgroupGetCpuacctStat;

View File

@ -293,7 +293,7 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
int ret; int ret;
virCgroupPtr cgroup; virCgroupPtr cgroup;
ret = virCgroupGetAppRoot(&cgroup); ret = virCgroupForSelf(&cgroup);
if (ret < 0) { if (ret < 0) {
virReportSystemError(-ret, "%s", virReportSystemError(-ret, "%s",
_("Unable to get cgroup for container")); _("Unable to get cgroup for container"));

View File

@ -967,19 +967,22 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
#endif #endif
/** /**
* virCgroupGetAppRoot: * virCgroupForSelf:
* *
* @group: Pointer to returned virCgroupPtr * @group: Pointer to returned virCgroupPtr
* *
* Obtain a cgroup representing the config of the
* current process
*
* Returns 0 on success * Returns 0 on success
*/ */
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
int virCgroupGetAppRoot(virCgroupPtr *group) int virCgroupForSelf(virCgroupPtr *group)
{ {
return virCgroupNew("/", group); return virCgroupNew("/", group);
} }
#else #else
int virCgroupGetAppRoot(virCgroupPtr *group ATTRIBUTE_UNUSED) int virCgroupForSelf(virCgroupPtr *group ATTRIBUTE_UNUSED)
{ {
return -ENXIO; return -ENXIO;
} }

View File

@ -49,7 +49,7 @@ int virCgroupForDriver(const char *name,
bool privileged, bool privileged,
bool create); bool create);
int virCgroupGetAppRoot(virCgroupPtr *group); int virCgroupForSelf(virCgroupPtr *group);
int virCgroupForDomain(virCgroupPtr driver, int virCgroupForDomain(virCgroupPtr driver,
const char *name, const char *name,