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;
virCgroupForDriver;
virCgroupForEmulator;
virCgroupForSelf;
virCgroupForVcpu;
virCgroupFree;
virCgroupGetAppRoot;
virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage;
virCgroupGetCpuacctStat;

View File

@ -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"));

View File

@ -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;
}

View File

@ -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,