render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
49d448
From 8354fa1d2e471699331961272bc38f5e4cfe7cb8 Mon Sep 17 00:00:00 2001
49d448
Message-Id: <8354fa1d2e471699331961272bc38f5e4cfe7cb8@dist-git>
49d448
From: Jiri Denemark <jdenemar@redhat.com>
49d448
Date: Wed, 22 Jun 2022 09:04:04 +0200
49d448
Subject: [PATCH] qemu_migration: Use qemuDomainSetMaxMemLock
49d448
MIME-Version: 1.0
49d448
Content-Type: text/plain; charset=UTF-8
49d448
Content-Transfer-Encoding: 8bit
49d448
49d448
This helper will not try to set the limit if it is already big enough,
49d448
which may be useful when libvirt daemon is running in a containerized
49d448
environment and is not allowed to change memory locking limit.
49d448
49d448
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
49d448
Reviewed-by: Ján Tomko <jtomko@redhat.com>
49d448
(cherry picked from commit 22ee8cbf090c45f999b76e3f8dc7a45065fc9edf)
49d448
49d448
https://bugzilla.redhat.com/show_bug.cgi?id=2089433
49d448
49d448
Conflicts:
49d448
	src/qemu/qemu_migration.c
49d448
            - refactoring for post-copy recovery not backported
49d448
49d448
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
49d448
---
49d448
 src/qemu/qemu_migration.c | 4 ++--
49d448
 1 file changed, 2 insertions(+), 2 deletions(-)
49d448
49d448
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
49d448
index 2635ef1162..10338f8e87 100644
49d448
--- a/src/qemu/qemu_migration.c
49d448
+++ b/src/qemu/qemu_migration.c
49d448
@@ -2974,7 +2974,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
49d448
 
49d448
     if (STREQ_NULLABLE(protocol, "rdma") &&
49d448
         vm->def->mem.hard_limit > 0 &&
49d448
-        virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) {
49d448
+        qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) < 0) {
49d448
         goto stopjob;
49d448
     }
49d448
 
49d448
@@ -4224,7 +4224,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
49d448
     case MIGRATION_DEST_HOST:
49d448
         if (STREQ(spec->dest.host.protocol, "rdma") &&
49d448
             vm->def->mem.hard_limit > 0 &&
49d448
-            virProcessSetMaxMemLock(vm->pid, vm->def->mem.hard_limit << 10) < 0) {
49d448
+            qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10, NULL) < 0) {
49d448
             goto exit_monitor;
49d448
         }
49d448
         rc = qemuMonitorMigrateToHost(priv->mon, migrate_flags,
49d448
-- 
49d448
2.35.1
49d448