mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
vircgroup: introduce virCgroupValidatePlacement helper
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
30f3516053
commit
20da059e18
@ -393,6 +393,23 @@ virCgroupDetectPlacement(virCgroupPtr group,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
virCgroupValidatePlacement(virCgroupPtr group,
|
||||||
|
pid_t pid)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
||||||
|
if (group->backends[i] &&
|
||||||
|
group->backends[i]->validatePlacement(group, pid) < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virCgroupDetect(virCgroupPtr group,
|
virCgroupDetect(virCgroupPtr group,
|
||||||
pid_t pid,
|
pid_t pid,
|
||||||
@ -430,12 +447,8 @@ virCgroupDetect(virCgroupPtr group,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Check that for every mounted controller, we found our placement */
|
/* Check that for every mounted controller, we found our placement */
|
||||||
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
if (virCgroupValidatePlacement(group, pid) < 0)
|
||||||
if (group->backends[i] &&
|
|
||||||
group->backends[i]->validatePlacement(group, pid) < 0) {
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) {
|
||||||
if (group->backends[i]) {
|
if (group->backends[i]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user