libxl: change reservedVNCPorts to reservedGraphicsPorts

A later change will use the PortAllocator for SPICE too.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2015-04-27 18:53:04 -06:00
parent 09f2faf933
commit 5a10fb1d2c
3 changed files with 5 additions and 5 deletions

View File

@ -140,7 +140,7 @@ struct _libxlDriverPrivate {
virObjectEventStatePtr domainEventState;
/* Immutable pointer, self-locking APIs */
virPortAllocatorPtr reservedVNCPorts;
virPortAllocatorPtr reservedGraphicsPorts;
/* Immutable pointer, self-locking APIs */
virPortAllocatorPtr migrationPorts;

View File

@ -715,7 +715,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
vm->def->graphics[0]->data.vnc.autoport) {
vnc_port = vm->def->graphics[0]->data.vnc.port;
if (vnc_port >= LIBXL_VNC_PORT_MIN) {
if (virPortAllocatorRelease(driver->reservedVNCPorts,
if (virPortAllocatorRelease(driver->reservedGraphicsPorts,
vnc_port) < 0)
VIR_DEBUG("Could not mark port %d as unused", vnc_port);
}
@ -979,7 +979,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
VIR_FREE(managed_save_path);
}
if (libxlBuildDomainConfig(driver->reservedVNCPorts, vm->def,
if (libxlBuildDomainConfig(driver->reservedGraphicsPorts, vm->def,
cfg->ctx, &d_config) < 0)
goto cleanup;

View File

@ -410,7 +410,7 @@ libxlStateCleanup(void)
virObjectUnref(libxl_driver->config);
virObjectUnref(libxl_driver->xmlopt);
virObjectUnref(libxl_driver->domains);
virObjectUnref(libxl_driver->reservedVNCPorts);
virObjectUnref(libxl_driver->reservedGraphicsPorts);
virObjectUnref(libxl_driver->migrationPorts);
virLockManagerPluginUnref(libxl_driver->lockManager);
@ -523,7 +523,7 @@ libxlStateInitialize(bool privileged,
}
/* Allocate bitmap for vnc port reservation */
if (!(libxl_driver->reservedVNCPorts =
if (!(libxl_driver->reservedGraphicsPorts =
virPortAllocatorNew(_("VNC"),
LIBXL_VNC_PORT_MIN,
LIBXL_VNC_PORT_MAX,