mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu_migration: Use qemuDomainSetMaxMemLock
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
dff51c7f57
commit
22ee8cbf09
@ -3181,7 +3181,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
|
|||||||
|
|
||||||
if (STREQ_NULLABLE(protocol, "rdma") &&
|
if (STREQ_NULLABLE(protocol, "rdma") &&
|
||||||
vm->def->mem.hard_limit > 0 &&
|
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;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4615,7 +4615,7 @@ qemuMigrationSrcStart(virDomainObj *vm,
|
|||||||
case MIGRATION_DEST_HOST:
|
case MIGRATION_DEST_HOST:
|
||||||
if (STREQ(spec->dest.host.protocol, "rdma") &&
|
if (STREQ(spec->dest.host.protocol, "rdma") &&
|
||||||
vm->def->mem.hard_limit > 0 &&
|
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 -1;
|
||||||
}
|
}
|
||||||
return qemuMonitorMigrateToHost(priv->mon, migrateFlags,
|
return qemuMonitorMigrateToHost(priv->mon, migrateFlags,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user