[libvirt PATCH 38/80] qemu: Make sure migrationPort is released even in callbacks

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

 



Normally migrationPort is released in the Finish phase, but we need to
make sure it is properly released also in case qemuMigrationDstFinish is
not called at all. Currently the only callback which is called in this
situation qemuMigrationDstPrepareCleanup which already releases
migrationPort. This patch adds similar handling to additional callbacks
which will be used in the future.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 3 +++
 src/qemu/qemu_process.c   | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 903c1dbf6b..ad9be3e68e 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5852,6 +5852,9 @@ qemuMigrationDstComplete(virQEMUDriver *driver,
 
     qemuMigrationParamsReset(driver, vm, asyncJob, jobPriv->migParams,
                              priv->job.apiFlags);
+
+    virPortAllocatorRelease(priv->migrationPort);
+    priv->migrationPort = 0;
 }
 
 
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c3a966983f..d92cd8cb5e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3488,6 +3488,8 @@ qemuProcessCleanupMigrationJob(virQEMUDriver *driver,
         priv->job.asyncJob != VIR_ASYNC_JOB_MIGRATION_OUT)
         return;
 
+    virPortAllocatorRelease(priv->migrationPort);
+    priv->migrationPort = 0;
     qemuDomainObjDiscardAsyncJob(vm);
 }
 
-- 
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