diff --git a/src/hypervisor/domain_cgroup.c b/src/hypervisor/domain_cgroup.c index fc0ad284c8..920ec8c895 100644 --- a/src/hypervisor/domain_cgroup.c +++ b/src/hypervisor/domain_cgroup.c @@ -603,10 +603,8 @@ virDomainCgroupSetupGlobalCpuCgroup(virDomainObj *vm, autoNodeset, &mem_mask, -1) < 0) return -1; - if (period || quota) { - if (virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0) - return -1; - } + if (virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0) + return -1; return 0; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 26647a9ae3..1eac27366a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8929,9 +8929,6 @@ static int qemuSetGlobalBWLive(virCgroup *cgroup, unsigned long long period, long long quota) { - if (period == 0 && quota == 0) - return 0; - if (virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0) return -1; @@ -9110,9 +9107,6 @@ qemuSetVcpusBWLive(virDomainObj *vm, virCgroup *cgroup, { size_t i; - if (period == 0 && quota == 0) - return 0; - if (!qemuDomainHasVcpuPids(vm)) return 0; @@ -9141,9 +9135,6 @@ qemuSetEmulatorBandwidthLive(virCgroup *cgroup, { g_autoptr(virCgroup) cgroup_emulator = NULL; - if (period == 0 && quota == 0) - return 0; - if (virCgroupNewThread(cgroup, VIR_CGROUP_THREAD_EMULATOR, 0, false, &cgroup_emulator) < 0) return -1; @@ -9161,9 +9152,6 @@ qemuSetIOThreadsBWLive(virDomainObj *vm, virCgroup *cgroup, { size_t i; - if (period == 0 && quota == 0) - return 0; - if (!vm->def->niothreadids) return 0; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f63fc3389d..b1c506a552 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2695,8 +2695,7 @@ qemuProcessSetupPid(virDomainObj *vm, } - if ((period || quota) && - virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0) + if (virDomainCgroupSetupVcpuBW(cgroup, period, quota) < 0) goto cleanup; /* Move the thread to the sub dir */