]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_migration: Avoid mem.hard_limit > 0 check
authorJiri Denemark <jdenemar@redhat.com>
Fri, 24 Jun 2022 14:26:06 +0000 (16:26 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 1 Jul 2022 09:28:34 +0000 (11:28 +0200)
My original commit v8.4.0-288-gf01fc4d119 accidentally forgot to fix
both instances of the same problem. While it fixed the destination side
of migration, the source one remained broken.

However, that commit was also wrong in saying the issue could have
caused unlimited memory locking to be allowed for QEMU when RDMA
migration was used. It could not, because the code would refuse to even
think about starting RDMA migration if hard_limit was not set. But
avoiding the "mem.hard_limit > 0" check is useful anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_migration.c

index 2a6b7b7819cf08813f8e8a5e016b5a8ccac6fdc0..9a10ce4abed5398f5356a5c64cc8b203ad558211 100644 (file)
@@ -4623,7 +4623,7 @@ qemuMigrationSrcStart(virDomainObj *vm,
     switch (spec->destType) {
     case MIGRATION_DEST_HOST:
         if (STREQ(spec->dest.host.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) {
             return -1;