feature #189: Added VNC_BASE_PORT to the configuration file, and PORT generation

This commit is contained in:
Ruben S. Montero committed 2010-03-05 19:43:34 +01:00
1 parent 28e9d41ab1
commit ec6b21ef9d
3 files changed
+24 -3

No files matched your search

+5
View File
@@ -15,6 +15,9 @@
#
# PORT: Port where oned will listen for xmlrpc calls.
#
# VNC_BASE_PORT: VNC ports for VMs can be automatically set to VNC_BASE_PORT +
# VMID
#
# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
#*******************************************************************************
@@ -26,6 +29,8 @@ VM_POLLING_INTERVAL = 60
PORT=2633
VNC_BASE_PORT = 5000
DEBUG_LEVEL=3
#*******************************************************************************
+6
View File
@@ -75,6 +75,12 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
attribute = new SingleAttribute("NETWORK_SIZE",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//NETWORK_SIZE
value = "5900";
attribute = new SingleAttribute("VNC_BASE_PORT",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//DEBUG_LEVEL
value = Log::WARNING;
+13 -3
View File
@@ -468,10 +468,20 @@ void VirtualMachine::parse_graphics()
if ( port.empty() )
{
ostringstream oss;
Nebula& nd = Nebula::instance();
oss << ( 5900 + oid );
graphics->replace("PORT", oss.str());
ostringstream oss;
istringstream iss;
int base_port;
string base_port_s;
nd.get_configuration_attribute("VNC_BASE_PORT",base_port_s);
iss.str(base_port_s);
iss >> base_port;
oss << ( base_port + oid );
graphics->replace("PORT", oss.str());
}
}