[libvirt PATCH v2 22/81] qemu: Create domain object at the end of qemuMigrationDstFinish

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We don't need the object until we get to the "endjob" label.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---

Notes:
    Version 2:
    - no change

 src/qemu/qemu_migration.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 12f06648d7..8a1210c8c7 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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) &&
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux