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