hypervisor: Drop dead code in virDomainCgroupSetupGlobalCpuCgroup()

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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-04-01 13:14:59 +02:00
parent cc4542e5d3
commit 85a6474907
4 changed files with 4 additions and 25 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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,

View File

@ -7637,7 +7637,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");