mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
add interface virCgroupGetAppRoot
because libvirt_lxc's cgroup mountpoint is what it shown in /proc/self/cgroup. we can get container's cgroup through virCgroupNew("/", &group), add interface virCgroupGetAppRoot to help container to get it's cgroup. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
This commit is contained in:
parent
4d4f371e09
commit
729acc23df
@ -85,6 +85,7 @@ virCgroupDenyDeviceMajor;
|
||||
virCgroupDenyDevicePath;
|
||||
virCgroupForDomain;
|
||||
virCgroupForDriver;
|
||||
virCgroupGetAppRoot;
|
||||
virCgroupForEmulator;
|
||||
virCgroupForVcpu;
|
||||
virCgroupFree;
|
||||
|
@ -965,6 +965,21 @@ int virCgroupForDriver(const char *name ATTRIBUTE_UNUSED,
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* virCgroupGetAppRoot:
|
||||
*
|
||||
* @group: Pointer to returned virCgroupPtr
|
||||
*
|
||||
* Returns 0 on success
|
||||
*/
|
||||
int virCgroupGetAppRoot(virCgroupPtr *group)
|
||||
{
|
||||
#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
|
||||
return virCgroupNew("/", group);
|
||||
#else
|
||||
return -ENXIO;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* virCgroupForDomain:
|
||||
|
@ -47,6 +47,8 @@ int virCgroupForDriver(const char *name,
|
||||
int privileged,
|
||||
int create);
|
||||
|
||||
int virCgroupGetAppRoot(virCgroupPtr *group);
|
||||
|
||||
int virCgroupForDomain(virCgroupPtr driver,
|
||||
const char *name,
|
||||
virCgroupPtr *group,
|
||||
|
Loading…
Reference in New Issue
Block a user