render / rpms / libvirt

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