]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Release nbd port from migrationPorts instead of remotePorts
authorweiwei li <weiweili821@gmail.com>
Fri, 31 Oct 2014 08:16:22 +0000 (16:16 +0800)
committerJán Tomko <jtomko@redhat.com>
Fri, 31 Oct 2014 11:20:06 +0000 (12:20 +0100)
commit 3e1e16aa8d4238241a1806cb9bdb3b9ad60db777 (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=1159245

Signed-off-by: Weiwei Li <nuonuoli@tencent.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_process.c

index ca70e35294ffdeb492b6fc23460cbb10c42e15e3..13239ebe31015b42e1f83d0f2a77ec42985ca466 100644 (file)
@@ -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)
index ef258cfad8ec21e4ed327875b08e638a82f8a24c..ba8ba82665869082af3d0375b38306d2a16a93ec 100644 (file)
@@ -4839,7 +4839,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
         }
     }
 
-    virPortAllocatorRelease(driver->remotePorts, priv->nbdPort);
+    virPortAllocatorRelease(driver->migrationPorts, priv->nbdPort);
     priv->nbdPort = 0;
 
     if (priv->agent) {