mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: vircgroupv2: mark only requested controllers as available
When detecting available controllers on host we can be limited by list of controllers from qemu.conf file. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
1d49cdcd11
commit
05807e5d42
@ -302,15 +302,15 @@ virCgroupV2DetectControllers(virCgroupPtr group,
|
||||
group->unified.controllers |= 1 << VIR_CGROUP_CONTROLLER_CPUACCT;
|
||||
}
|
||||
|
||||
if (controllers >= 0)
|
||||
group->unified.controllers &= controllers;
|
||||
|
||||
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++)
|
||||
VIR_DEBUG("Controller '%s' present=%s",
|
||||
virCgroupV2ControllerTypeToString(i),
|
||||
(group->unified.controllers & 1 << i) ? "yes" : "no");
|
||||
|
||||
if (controllers >= 0)
|
||||
return controllers & group->unified.controllers;
|
||||
else
|
||||
return group->unified.controllers;
|
||||
return group->unified.controllers;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user