提交 884479b4 编写于 作者: P Pavel Hrdina

vircgroup: introduce virCgroupV2DenyAllDevices

If we want to deny all devices we just need to replace any existing
program with new program with empty map.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 285aefb3
......@@ -1824,6 +1824,16 @@ virCgroupV2AllowAllDevices(virCgroupPtr group,
}
static int
virCgroupV2DenyAllDevices(virCgroupPtr group)
{
if (virCgroupV2DevicesDetectProg(group) < 0)
return -1;
return virCgroupV2DevicesCreateProg(group);
}
virCgroupBackend virCgroupV2Backend = {
.type = VIR_CGROUP_BACKEND_TYPE_V2,
......@@ -1876,6 +1886,7 @@ virCgroupBackend virCgroupV2Backend = {
.allowDevice = virCgroupV2AllowDevice,
.denyDevice = virCgroupV2DenyDevice,
.allowAllDevices = virCgroupV2AllowAllDevices,
.denyAllDevices = virCgroupV2DenyAllDevices,
.setCpuShares = virCgroupV2SetCpuShares,
.getCpuShares = virCgroupV2GetCpuShares,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册