mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
vircgroup: introduce virCgroupCopyMounts helper
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a4353381f1
commit
069f0994ab
@ -239,6 +239,23 @@ virCgroupSetBackends(virCgroupPtr group)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
virCgroupCopyMounts(virCgroupPtr group,
|
||||||
|
virCgroupPtr parent)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
||||||
|
if (group->backends[i] &&
|
||||||
|
group->backends[i]->copyMounts(group, parent) < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process /proc/mounts figuring out what controllers are
|
* Process /proc/mounts figuring out what controllers are
|
||||||
* mounted and where
|
* mounted and where
|
||||||
@ -375,12 +392,8 @@ virCgroupDetect(virCgroupPtr group,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
if (virCgroupCopyMounts(group, parent) < 0)
|
||||||
if (group->backends[i] &&
|
return -1;
|
||||||
group->backends[i]->copyMounts(group, parent) < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (virCgroupDetectMounts(group) < 0)
|
if (virCgroupDetectMounts(group) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user