From: Jiri Denemark Date: Tue, 10 May 2022 13:20:25 +0000 (+0200) Subject: qemu: Register qemuProcessCleanupMigrationJob after Begin phase X-Git-Tag: v8.5.0-rc1~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21469f6076399662f9674fb77cbd6e1190049a19;p=thirdparty%2Flibvirt.git qemu: Register qemuProcessCleanupMigrationJob after Begin phase The callback will properly cleanup non-p2p migration job in case the migrating domain dies between Begin and Perform while the client which controls the migration is not cooperating (normally the API for the next migration phase would handle this). The same situation can happen even after Prepare and Perform phases, but they both already register a suitable callback, so no fix is needed there. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 8c969344ce..7f766234ee 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2902,6 +2902,8 @@ qemuMigrationSrcBegin(virConnectPtr conn, if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, qemuMigrationAnyConnectionClosed) < 0) goto endjob; + + qemuDomainCleanupAdd(vm, qemuProcessCleanupMigrationJob); } ret = g_steal_pointer(&xml);