[libvirt PATCH 71/80] qemu: Register qemuProcessCleanupMigrationJob after Begin phase

Jiri Denemark posted 80 patches 3 years, 9 months ago
There is a newer version of this series
[libvirt PATCH 71/80] qemu: Register qemuProcessCleanupMigrationJob after Begin phase
Posted by Jiri Denemark 3 years, 9 months ago
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>
---
 src/qemu/qemu_migration.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 1fc978bad5..38a67f7e20 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2939,6 +2939,7 @@ qemuMigrationSrcBegin(virConnectPtr conn,
             VIR_FREE(xml);
             goto endjob;
         }
+        qemuDomainCleanupAdd(vm, qemuProcessCleanupMigrationJob);
         qemuMigrationJobContinue(vm);
     } else {
         goto endjob;
-- 
2.35.1
Re: [libvirt PATCH 71/80] qemu: Register qemuProcessCleanupMigrationJob after Begin phase
Posted by Peter Krempa 3 years, 9 months ago
On Tue, May 10, 2022 at 17:21:32 +0200, Jiri Denemark wrote:
> 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>
> ---
>  src/qemu/qemu_migration.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>