This helper will not try to set the limit if it is already big enough,
which may be useful when libvirt daemon is running in a containerized
environment and is not allowed to change memory locking limit.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_migration.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d93e7e9c74..fe63f45629 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3181,7 +3181,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
if (STREQ_NULLABLE(protocol, "rdma") &&
vm->def->mem.hard_limit > 0 &&
- virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10)
< 0) {
+ qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) <
0) {
goto error;
}
@@ -4615,7 +4615,7 @@ qemuMigrationSrcStart(virDomainObj *vm,
case MIGRATION_DEST_HOST:
if (STREQ(spec->dest.host.protocol, "rdma") &&
vm->def->mem.hard_limit > 0 &&
- virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit <<
10) < 0) {
+ qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL)
< 0) {
return -1;
}
return qemuMonitorMigrateToHost(priv->mon, migrateFlags,
--
2.35.1