From: Jim Fehlig Date: Tue, 28 Apr 2015 00:53:04 +0000 (-0600) Subject: libxl: change reservedVNCPorts to reservedGraphicsPorts X-Git-Tag: v1.2.16-rc2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a10fb1d2c9aa419a251474560a267f067ad912b;p=thirdparty%2Flibvirt.git libxl: change reservedVNCPorts to reservedGraphicsPorts A later change will use the PortAllocator for SPICE too. Signed-off-by: Jim Fehlig --- diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index 0a1c0db9dc..9c29b1e289 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -140,7 +140,7 @@ struct _libxlDriverPrivate { virObjectEventStatePtr domainEventState; /* Immutable pointer, self-locking APIs */ - virPortAllocatorPtr reservedVNCPorts; + virPortAllocatorPtr reservedGraphicsPorts; /* Immutable pointer, self-locking APIs */ virPortAllocatorPtr migrationPorts; diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 5f5f8e53f2..68dd28e9c8 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -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; diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 12be81609a..c297d12271 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -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,