]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Register qemuProcessCleanupMigrationJob after Begin phase
authorJiri Denemark <jdenemar@redhat.com>
Tue, 10 May 2022 13:20:25 +0000 (15:20 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 7 Jun 2022 15:40:20 +0000 (17:40 +0200)
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 <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_migration.c

index 8c969344ce9fa094ae8ce4e77ed5eccda0c0939a..7f766234eefddb81da675b34e510e7c48950abef 100644 (file)
@@ -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);