提交 2dd4b393 编写于 作者: Z Zeng Junliang 提交者: Ján Tomko

qemu: clean up migration ports when migration cancelled

If there's a migration cancelled, the bitmap of migration port should be
cleaned up too.
Signed-off-by: NZeng Junliang <zengjunliang@huawei.com>
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
(cherry picked from commit c92ca769)
上级 c94b37d4
......@@ -3930,12 +3930,16 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
qemuDomainObjPrivatePtr priv = vm->privateData;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virCapsPtr caps = NULL;
unsigned short port;
VIR_DEBUG("driver=%p, dconn=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
"cookieout=%p, cookieoutlen=%p, flags=%lx, retcode=%d",
driver, dconn, vm, NULLSTR(cookiein), cookieinlen,
cookieout, cookieoutlen, flags, retcode);
port = priv->migrationPort;
priv->migrationPort = 0;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
......@@ -3982,8 +3986,6 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
}
qemuMigrationStopNBDServer(driver, vm, mig);
virPortAllocatorRelease(driver->migrationPorts, priv->migrationPort);
priv->migrationPort = 0;
if (flags & VIR_MIGRATE_PERSIST_DEST) {
virDomainDefPtr vmdef;
......@@ -4116,6 +4118,7 @@ endjob:
}
cleanup:
virPortAllocatorRelease(driver->migrationPorts, port);
if (vm) {
VIR_FREE(priv->origname);
virObjectUnlock(vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册