提交 be598c5f 编写于 作者: W weiwei li 提交者: Ján Tomko

qemu: Release nbd port from migrationPorts instead of remotePorts

commit 3e1e16aa (Use a port from the
migration range for NBD as well) changed ndb port allocation from
remotePorts to migrationPorts, but did not change the port releasing
process, which makes an error when migrating several times (above 64):
error: internal error: Unable to find an unused port in range
'migration' (49152-49215)

https://bugzilla.redhat.com/show_bug.cgi?id=1159245Signed-off-by: NWeiwei Li <nuonuoli@tencent.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 720be2eb
......@@ -1389,7 +1389,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
cleanup:
VIR_FREE(diskAlias);
if (ret < 0)
virPortAllocatorRelease(driver->remotePorts, port);
virPortAllocatorRelease(driver->migrationPorts, port);
return ret;
}
......@@ -1595,7 +1595,7 @@ qemuMigrationStopNBDServer(virQEMUDriverPtr driver,
qemuDomainObjExitMonitor(driver, vm);
virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
priv->nbdPort = 0;
}
......@@ -2813,7 +2813,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
VIR_FORCE_CLOSE(dataFD[1]);
if (vm) {
if (ret < 0) {
virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
priv->nbdPort = 0;
}
if (ret >= 0 || vm->persistent)
......
......@@ -4839,7 +4839,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
}
}
virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
priv->nbdPort = 0;
if (priv->agent) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册