[PATCH 2/4] hypervisor: Drop dead code in virDomainCgroupSetupGlobalCpuCgroup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since its introduction in v1.3.2-43-gef1fa55e46 there is a dead
code in virDomainCgroupSetupGlobalCpuCgroup() (well,
qemuSetupGlobalCpuCgroup() back then). The code formats NUMA
nodeset but never sets it.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/ch/ch_process.c            |  3 +--
 src/hypervisor/domain_cgroup.c | 21 +--------------------
 src/hypervisor/domain_cgroup.h |  3 +--
 src/qemu/qemu_process.c        |  2 +-
 4 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index 00d94ddcbe..785e4f8769 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -526,8 +526,7 @@ virCHProcessStart(virCHDriver *driver,
 
     VIR_DEBUG("Setting global CPU cgroup (if required)");
     if (virDomainCgroupSetupGlobalCpuCgroup(vm,
-                                            priv->cgroup,
-                                            priv->autoNodeset) < 0)
+                                            priv->cgroup) < 0)
         goto cleanup;
 
     VIR_DEBUG("Setting vCPU tuning/settings");
diff --git a/src/hypervisor/domain_cgroup.c b/src/hypervisor/domain_cgroup.c
index 920ec8c895..5af88155bc 100644
--- a/src/hypervisor/domain_cgroup.c
+++ b/src/hypervisor/domain_cgroup.c
@@ -572,13 +572,10 @@ virDomainCgroupSetupCpusetCpus(virCgroup *cgroup,
 
 int
 virDomainCgroupSetupGlobalCpuCgroup(virDomainObj *vm,
-                                    virCgroup *cgroup,
-                                    virBitmap *autoNodeset)
+                                    virCgroup *cgroup)
 {
     unsigned long long period = vm->def->cputune.global_period;
     long long quota = vm->def->cputune.global_quota;
-    g_autofree char *mem_mask = NULL;
-    virDomainNumatuneMemMode mem_mode;
 
     if ((period || quota) &&
         !virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPU)) {
@@ -587,22 +584,6 @@ virDomainCgroupSetupGlobalCpuCgroup(virDomainObj *vm,
         return -1;
     }
 
-    /*
-     * If CPU cgroup controller is not initialized here, then we need
-     * neither period nor quota settings.  And if CPUSET controller is
-     * not initialized either, then there's nothing to do anyway.
-     */
-    if (!virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPU) &&
-        !virCgroupHasController(cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
-        return 0;
-
-
-    if (virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) == 0 &&
-        mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
-        virDomainNumatuneMaybeFormatNodeset(vm->def->numa,
-                                            autoNodeset, &mem_mask, -1) < 0)
-        return -1;
-
     if (virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0)
         return -1;
 
diff --git a/src/hypervisor/domain_cgroup.h b/src/hypervisor/domain_cgroup.h
index 20893e1b46..f8d261a080 100644
--- a/src/hypervisor/domain_cgroup.h
+++ b/src/hypervisor/domain_cgroup.h
@@ -98,8 +98,7 @@ virDomainCgroupSetupCpusetCpus(virCgroup *cgroup,
                                virBitmap *cpumask);
 int
 virDomainCgroupSetupGlobalCpuCgroup(virDomainObj *vm,
-                                    virCgroup *cgroup,
-                                    virBitmap *autoNodeset);
+                                    virCgroup *cgroup);
 int
 virDomainCgroupRemoveCgroup(virDomainObj *vm,
                             virCgroup *cgroup,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f3eb742406..bd13cc5103 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7642,7 +7642,7 @@ qemuProcessLaunch(virConnectPtr conn,
         goto cleanup;
 
     VIR_DEBUG("Setting global CPU cgroup (if required)");
-    if (virDomainCgroupSetupGlobalCpuCgroup(vm, priv->cgroup, priv->autoNodeset) < 0)
+    if (virDomainCgroupSetupGlobalCpuCgroup(vm, priv->cgroup) < 0)
         goto cleanup;
 
     VIR_DEBUG("Setting vCPU tuning/settings");
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux