forked from rpms/libvirt
86 lines
3.2 KiB
Diff
86 lines
3.2 KiB
Diff
|
From a1d825e5dcb8cbe0854fa852d25e5997a52d57cd Mon Sep 17 00:00:00 2001
|
||
|
Message-Id: <a1d825e5dcb8cbe0854fa852d25e5997a52d57cd@dist-git>
|
||
|
From: Jiri Denemark <jdenemar@redhat.com>
|
||
|
Date: Wed, 27 Jul 2022 14:33:23 +0200
|
||
|
Subject: [PATCH] qemu: Restore original memory locking limit on reconnect
|
||
|
|
||
|
Commit v8.4.0-287-gd4d3bb8130 tried to make sure the original
|
||
|
pre-migration memory locking limit is restored at the end of migration,
|
||
|
but it missed the case when libvirt daemon is restarted during
|
||
|
migration which needs to be aborted on reconnect.
|
||
|
|
||
|
And if this was not enough, I forgot to actually save the status XML
|
||
|
after setting the field in priv (in the commit mentioned above and also
|
||
|
in v8.4.0-291-gd375993ab3).
|
||
|
|
||
|
https://bugzilla.redhat.com/show_bug.cgi?id=2107424
|
||
|
|
||
|
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||
|
(cherry picked from commit bb9badb9168ad0d40bca86b6463ef504624f096d)
|
||
|
|
||
|
Conflicts:
|
||
|
src/qemu/qemu_migration.c
|
||
|
- commit v8.5.0-2-gf9dcc01a0f not backported
|
||
|
|
||
|
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||
|
---
|
||
|
src/qemu/qemu_migration.c | 13 +++++++++----
|
||
|
src/qemu/qemu_process.c | 2 ++
|
||
|
2 files changed, 11 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||
|
index 9289df81eb..61fcaf4258 100644
|
||
|
--- a/src/qemu/qemu_migration.c
|
||
|
+++ b/src/qemu/qemu_migration.c
|
||
|
@@ -4672,10 +4672,12 @@ qemuMigrationSrcStart(virDomainObj *vm,
|
||
|
switch (spec->destType) {
|
||
|
case MIGRATION_DEST_HOST:
|
||
|
if (STREQ(spec->dest.host.protocol, "rdma") &&
|
||
|
- vm->def->mem.hard_limit > 0 &&
|
||
|
- qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
|
||
|
- &priv->preMigrationMemlock) < 0) {
|
||
|
- return -1;
|
||
|
+ vm->def->mem.hard_limit > 0) {
|
||
|
+ if (qemuDomainSetMaxMemLock(vm, vm->def->mem.hard_limit << 10,
|
||
|
+ &priv->preMigrationMemlock) < 0)
|
||
|
+ return -1;
|
||
|
+ /* Store the original memory locking limit */
|
||
|
+ qemuDomainSaveStatus(vm);
|
||
|
}
|
||
|
return qemuMonitorMigrateToHost(priv->mon, migrateFlags,
|
||
|
spec->dest.host.protocol,
|
||
|
@@ -4870,6 +4872,9 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||
|
|
||
|
if (qemuDomainSetMaxMemLock(vm, limit << 10, &priv->preMigrationMemlock) < 0)
|
||
|
goto error;
|
||
|
+
|
||
|
+ /* Store the original memory locking limit */
|
||
|
+ qemuDomainSaveStatus(vm);
|
||
|
}
|
||
|
|
||
|
if (storageMigration) {
|
||
|
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||
|
index 771a623ef7..1c28d4b102 100644
|
||
|
--- a/src/qemu/qemu_process.c
|
||
|
+++ b/src/qemu/qemu_process.c
|
||
|
@@ -3677,6 +3677,7 @@ qemuProcessRecoverMigration(virQEMUDriver *driver,
|
||
|
{
|
||
|
virDomainJobStatus migStatus = VIR_DOMAIN_JOB_STATUS_NONE;
|
||
|
qemuDomainJobPrivate *jobPriv = job->privateData;
|
||
|
+ qemuDomainObjPrivate *priv = vm->privateData;
|
||
|
virDomainState state;
|
||
|
int reason;
|
||
|
int rc;
|
||
|
@@ -3726,6 +3727,7 @@ qemuProcessRecoverMigration(virQEMUDriver *driver,
|
||
|
|
||
|
qemuMigrationParamsReset(driver, vm, VIR_ASYNC_JOB_NONE,
|
||
|
jobPriv->migParams, job->apiFlags);
|
||
|
+ qemuDomainSetMaxMemLock(vm, 0, &priv->preMigrationMemlock);
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
--
|
||
|
2.35.1
|
||
|
|