From 0cde517cd560d47824e0e98fab32b62cbd0f89ea Mon Sep 17 00:00:00 2001 Message-Id: <0cde517cd560d47824e0e98fab32b62cbd0f89ea@dist-git> From: Pavel Hrdina Date: Mon, 1 Jul 2019 17:08:12 +0200 Subject: [PATCH] util: implement virCgroupV2(Set|Get)CpusetMemoryMigrate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cgroups v2 don't have memory_migrate interface and the migration is enabled by default. Signed-off-by: Pavel Hrdina (cherry picked from commit 77c1cf4da2f761a91756c09fa4fd37ae1802e650) Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1689297 Signed-off-by: Pavel Hrdina Message-Id: Reviewed-by: Ján Tomko --- src/util/vircgroupv2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 59b8c4ad2c..bc6ced2367 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -1584,6 +1584,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 = { .type = VIR_CGROUP_BACKEND_TYPE_V2, @@ -1646,6 +1663,8 @@ virCgroupBackend virCgroupV2Backend = { .setCpusetMems = virCgroupV2SetCpusetMems, .getCpusetMems = virCgroupV2GetCpusetMems, + .setCpusetMemoryMigrate = virCgroupV2SetCpusetMemoryMigrate, + .getCpusetMemoryMigrate = virCgroupV2GetCpusetMemoryMigrate, }; -- 2.22.0