[libvirt] [PATCH 1/2] qemu: migration:Release nbd port from migrationPorts instead of remotePorts

commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal times(above 64). Signed-off-by: Weiwei Li <nuonuoli@tencent.com> --- src/qemu/qemu_migration.c | 8 ++++---- src/qemu/qemu_process.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ca70e35..0ad8054 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1351,7 +1351,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver, unsigned short port = 0; char *diskAlias = NULL; size_t i; - + VIR_DEBUG("DEBUG: in qemuMigrationStartNBDServer"); for (i = 0; i < vm->def->ndisks; i++) { virDomainDiskDefPtr disk = vm->def->disks[i]; @@ -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) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ef258cf..ba8ba82 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4839,7 +4839,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, } } - virPortAllocatorRelease(driver->remotePorts, priv->nbdPort); + virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort); priv->nbdPort = 0; if (priv->agent) { -- 1.7.1

On 2014/10/31 16:16, weiwei li wrote:
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal times(above 64).
There are 63(maybe 64) migration ports available. One nbd allocates one port. So do we have at most 63 virtual disks in migration? If so, I think it's not enough. what about changing migrationPorts to remotePorts instead? That's my opinion. I hope to receive others' . :-)

On 10/31/2014 10:15 AM, Wang Rui wrote:
On 2014/10/31 16:16, weiwei li wrote:
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal times(above 64).
There are 63(maybe 64) migration ports available. One nbd allocates one port. So do we have at most 63 virtual disks in migration? If so, I think it's not enough. what about changing migrationPorts to remotePorts instead?
We only allocate one NBD port per domain, so two ports should be enough for migrating 63 disks (one for NBD, one for the rest). And the migration port range can be configured in qemu.conf. Jan

On 10/31/2014 09:16 AM, weiwei li wrote:
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal times(above 64).
Oops, thanks for catching that.
Signed-off-by: Weiwei Li <nuonuoli@tencent.com <mailto:nuonuoli@tencent.com>> ---
Your mail was sent as HTML. After applying it with 'git am', there were some unrelated strings in the commit message: --20cf306848c9caea5c0506b39c3d Content-Type: text/plain; charset=UTF-8 Please use 'git send-email' in the future.
src/qemu/qemu_migration.c | 8 ++++---- src/qemu/qemu_process.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ca70e35..0ad8054 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1351,7 +1351,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver, unsigned short port = 0; char *diskAlias = NULL; size_t i; - + VIR_DEBUG("DEBUG: in qemuMigrationStartNBDServer"); for (i = 0; i < vm->def->ndisks; i++) { virDomainDiskDefPtr disk = vm->def->disks[i];
ACK, I will remove the leftover debug message and push the patch later today. Jan

On 10/31/2014 06:02 AM, Ján Tomko wrote:
On 10/31/2014 09:16 AM, weiwei li wrote:
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777(Use a port from the migration range for NBD as well) change ndb port allocation from remotePorts to migrationPorts, but does not change the port releasing process, which makes an error when migration seveal times(above 64).
Oops, thanks for catching that.
While you're at it.... * s/commit/commit id/ * Add a space between 777 and ( in the first sentance * Note: could also change to "commit id '3e1e16aa' (...)" * s/when migration seveal times/when migrating several times/ John
Signed-off-by: Weiwei Li <nuonuoli@tencent.com <mailto:nuonuoli@tencent.com>> ---
Your mail was sent as HTML. After applying it with 'git am', there were some unrelated strings in the commit message: --20cf306848c9caea5c0506b39c3d Content-Type: text/plain; charset=UTF-8
Please use 'git send-email' in the future.
src/qemu/qemu_migration.c | 8 ++++---- src/qemu/qemu_process.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ca70e35..0ad8054 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1351,7 +1351,7 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver, unsigned short port = 0; char *diskAlias = NULL; size_t i; - + VIR_DEBUG("DEBUG: in qemuMigrationStartNBDServer"); for (i = 0; i < vm->def->ndisks; i++) { virDomainDiskDefPtr disk = vm->def->disks[i];
ACK, I will remove the leftover debug message and push the patch later today.
Jan
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (4)
-
John Ferlan
-
Ján Tomko
-
Wang Rui
-
weiwei li