mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
qemuSetupMemoryCgroup: Handle hard_limit properly
Since 16bcb3 we have a regression. The hard_limit is set unconditionally. By default the limit is zero. Hence, if user hasn't configured any, we set the zero in cgroup subsystem making the kernel kill the corresponding qemu process immediately. The proper fix is to set hard_limit iff user has configured any. (cherry picked from commit 94a24dd3a953f415596dd2800287c9010fa51c4c) Conflicts: src/qemu/qemu_cgroup.c
This commit is contained in:
parent
9421fd0010
commit
11253a09f2
@ -618,6 +618,7 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) {
|
||||
if (vm->def->mem.hard_limit != 0) {
|
||||
rc = virCgroupSetMemoryHardLimit(priv->cgroup, vm->def->mem.hard_limit);
|
||||
if (rc != 0) {
|
||||
virReportSystemError(-rc,
|
||||
@ -625,6 +626,7 @@ int qemuSetupCgroup(virQEMUDriverPtr driver,
|
||||
vm->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
if (vm->def->mem.soft_limit != 0) {
|
||||
rc = virCgroupSetMemorySoftLimit(priv->cgroup, vm->def->mem.soft_limit);
|
||||
if (rc != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user