mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Make sure migrationPort is released even in callbacks
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@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
cff2e25043
commit
dbfcbe0896
@ -5821,6 +5821,9 @@ qemuMigrationDstComplete(virQEMUDriver *driver,
|
||||
|
||||
qemuMigrationParamsReset(driver, vm, asyncJob, jobPriv->migParams,
|
||||
priv->job.apiFlags);
|
||||
|
||||
virPortAllocatorRelease(priv->migrationPort);
|
||||
priv->migrationPort = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3437,6 +3437,8 @@ qemuProcessCleanupMigrationJob(virQEMUDriver *driver,
|
||||
priv->job.asyncJob != VIR_ASYNC_JOB_MIGRATION_OUT)
|
||||
return;
|
||||
|
||||
virPortAllocatorRelease(priv->migrationPort);
|
||||
priv->migrationPort = 0;
|
||||
qemuDomainObjDiscardAsyncJob(vm);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user