]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_migration: Don't set unlimited memlock limit for RDMA
authorJiri Denemark <jdenemar@redhat.com>
Thu, 23 Jun 2022 12:25:30 +0000 (14:25 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 23 Jun 2022 14:45:39 +0000 (16:45 +0200)
Our documentation says RDMA migration requires hard_limit to be set so
that we know how big memory locking limit should be set for the domain
during migration. But since commit v1.2.13-71-gcf521fc8ba (which changed
the default hard_limit value from 0 to
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) we were actually setting memlock
limit to unlimited if hard_limit was not set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration.c

index 04903a424f002149d1e0fb7d768d315de7cdb6d4..e4e0417bdecfef78d95b1779f05065126a9db7cb 100644 (file)
@@ -3180,7 +3180,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
     }
 
     if (STREQ_NULLABLE(protocol, "rdma") &&
-        vm->def->mem.hard_limit > 0 &&
+        virMemoryLimitIsSet(vm->def->mem.hard_limit) &&
         qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
                                 &priv->preMigrationMemlock) < 0) {
         goto error;