]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Create domain object at the end of qemuMigrationDstFinish
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)
We don't need the object until we get to the "endjob" label.

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 4e95c2655c55bb92f417b9c876cb334c6ccd9d69..29302128eab570daed23d047c91539e199cadc2d 100644 (file)
@@ -5949,11 +5949,7 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
                                  VIR_DOMAIN_RUNNING,
                                  VIR_DOMAIN_RUNNING_MIGRATED);
         }
-    }
-
-    dom = virGetDomain(dconn, vm->def->name, vm->def->uuid, vm->def->id);
 
-    if (inPostCopy) {
         /* The only RESUME event during post-copy migration is triggered by
          * QEMU when the running domain moves from the source to the
          * destination host, but then the migration keeps running until all
@@ -5981,6 +5977,8 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
     /* Guest is successfully running, so cancel previous auto destroy */
     qemuProcessAutoDestroyRemove(driver, vm);
 
+    dom = virGetDomain(dconn, vm->def->name, vm->def->uuid, vm->def->id);
+
  endjob:
     if (!dom &&
         !(flags & VIR_MIGRATE_OFFLINE) &&