diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 1ce6ab6f7f..331386663e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5821,6 +5821,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 b039108ff7..d3769de496 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3437,6 +3437,8 @@ qemuProcessCleanupMigrationJob(virQEMUDriver *driver, priv->job.asyncJob != VIR_ASYNC_JOB_MIGRATION_OUT) return; + virPortAllocatorRelease(priv->migrationPort); + priv->migrationPort = 0; qemuDomainObjDiscardAsyncJob(vm); }