util: implement virCgroupV2(Set|Get)CpusetMemoryMigrate

Cgroups v2 don't have memory_migrate interface and the migration is
enabled by default.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2019-02-19 15:53:34 +01:00
parent 74e7da0605
commit 77c1cf4da2

View File

@ -1583,6 +1583,23 @@ virCgroupV2GetCpusetMems(virCgroupPtr group,
} }
static int
virCgroupV2SetCpusetMemoryMigrate(virCgroupPtr group ATTRIBUTE_UNUSED,
bool migrate ATTRIBUTE_UNUSED)
{
return 0;
}
static int
virCgroupV2GetCpusetMemoryMigrate(virCgroupPtr group ATTRIBUTE_UNUSED,
bool *migrate)
{
*migrate = true;
return 0;
}
virCgroupBackend virCgroupV2Backend = { virCgroupBackend virCgroupV2Backend = {
.type = VIR_CGROUP_BACKEND_TYPE_V2, .type = VIR_CGROUP_BACKEND_TYPE_V2,
@ -1645,6 +1662,8 @@ virCgroupBackend virCgroupV2Backend = {
.setCpusetMems = virCgroupV2SetCpusetMems, .setCpusetMems = virCgroupV2SetCpusetMems,
.getCpusetMems = virCgroupV2GetCpusetMems, .getCpusetMems = virCgroupV2GetCpusetMems,
.setCpusetMemoryMigrate = virCgroupV2SetCpusetMemoryMigrate,
.getCpusetMemoryMigrate = virCgroupV2GetCpusetMemoryMigrate,
}; };