提交 804a809a 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 b1d3154a
......@@ -1096,9 +1096,9 @@ virCgroupDenyDevicePath;
virCgroupForDomain;
virCgroupForDriver;
virCgroupForEmulator;
virCgroupForSelf;
virCgroupForVcpu;
virCgroupFree;
virCgroupGetAppRoot;
virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage;
virCgroupGetCpuacctStat;
......
......@@ -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"));
......
......@@ -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;
}
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册