[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
ChangeSet 1.1609, 2005/05/31 14:33:04+01:00, cl349@xxxxxxxxxxxxxxxxxxxx Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk XendRoot.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 76 insertions(+), 6 deletions(-) diff -Nru a/tools/python/xen/xend/XendRoot.py b/tools/python/xen/xend/XendRoot.py --- a/tools/python/xen/xend/XendRoot.py 2005-05-31 12:03:23 -04:00 +++ b/tools/python/xen/xend/XendRoot.py 2005-05-31 12:03:23 -04:00 @@ -15,6 +15,7 @@ import EventServer from XendLogging import XendLogging +from XendError import XendError # Initial create of the event server. eserver = EventServer.instance() @@ -45,16 +46,34 @@ """Default level of information to be logged.""" loglevel_default = 'DEBUG' + """Default for the flag indicating whether xend should run an http server.""" + xend_http_server_default = 'no' + """Default interface address xend listens at. """ xend_address_default = '' + """Default for the flag indicating whether xend should run a relocation server.""" + xend_relocation_server_default = 'yes' + + """Default interface address the xend relocation server listens at. """ + xend_relocation_address_default = '' + """Default port xend serves HTTP at. """ xend_port_default = '8000' """Default port xend serves events at. """ xend_event_port_default = '8001' - """Default inteface address xend listens at for consoles.""" + """Default port xend serves relocation at. """ + xend_relocation_port_default = '8002' + + """Default for the flag indicating whether xend should run a unix-domain server.""" + xend_unix_server_default = 'yes' + + """Default path the unix-domain server listens at.""" + xend_unix_path_default = '/var/lib/xend/xend-socket' + + """Default interface address xend listens at for consoles.""" console_address_default = 'localhost' """Default port xend serves consoles at. """ @@ -158,6 +177,7 @@ logfile = self.get_config_value("logfile", self.logfile_default) loglevel = self.get_config_value("loglevel", self.loglevel_default) self.logging = XendLogging(logfile, level=loglevel) + #self.logging.addLogStderr() def get_logging(self): """Get the XendLogging instance. @@ -219,15 +239,45 @@ """ return sxp.child_value(self.config, name, val=val) + def get_config_bool(self, name, val=None): + v = self.get_config_value(name, val) + if v in ['yes', '1', 'on', 1, True]: + return True + if v in ['no', '0', 'off', 0, False]: + return False + raise XendError("invalid xend config %s: expected bool: %s" % (name, v)) + + def get_config_int(self, name, val=None): + v = self.get_config_value(name, val) + try: + return int(v) + except Exception, ex: + raise XendError("invalid xend config %s: expected int: %s" % (name, v)) + + def get_xend_http_server(self): + """Get the flag indicating whether xend should run an http server. + """ + return self.get_config_bool("xend-http-server", self.xend_http_server_default) + + def get_xend_relocation_server(self): + """Get the flag indicating whether xend should run a relocation server. + """ + return self.get_config_bool("xend-relocation-server", self.xend_relocation_server_default) + def get_xend_port(self): """Get the port xend listens at for its HTTP interface. """ - return int(self.get_config_value('xend-port', self.xend_port_default)) + return self.get_config_int('xend-port', self.xend_port_default) def get_xend_event_port(self): """Get the port xend listens at for connection to its event server. """ - return int(self.get_config_value('xend-event-port', self.xend_event_port_default)) + return self.get_config_int('xend-event-port', self.xend_event_port_default) + + def get_xend_relocation_port(self): + """Get the port xend listens at for connection to its relocation server. + """ + return self.get_config_int('xend-relocation-port', self.xend_relocation_port_default) def get_xend_address(self): """Get the address xend listens at for its HTTP and event ports. @@ -237,6 +287,24 @@ """ return self.get_config_value('xend-address', self.xend_address_default) + def get_xend_relocation_address(self): + """Get the address xend listens at for its HTTP and event ports. + This defaults to the empty string which allows all hosts to connect. + If this is set to 'localhost' only the localhost will be able to connect + to the HTTP and event ports. + """ + return self.get_config_value('xend-relocation-address', self.xend_relocation_address_default) + + def get_xend_unix_server(self): + """Get the flag indicating whether xend should run a unix-domain server. + """ + return self.get_config_bool("xend-unix-server", self.xend_unix_server_default) + + def get_xend_unix_path(self): + """Get the path the xend unix-domain server listens at. + """ + return self.get_config_value("xend-unix-path", self.xend_unix_path_default) + def get_console_address(self): """Get the address xend listens at for its console ports. This defaults to 'localhost', allowing only the localhost to connect @@ -248,7 +316,7 @@ def get_console_port_base(self): """Get the base port number used to generate console ports for domains. """ - return int(self.get_config_value('console-port-base', self.console_port_base_default)) + return self.get_config_int('console-port-base', self.console_port_base_default) def get_block_script(self, type): return self.get_config_value('block-%s' % type, '') @@ -256,6 +324,9 @@ def get_network_script(self): return self.get_config_value('network-script', 'network') + def get_enable_dump(self): + return self.get_config_value('enable-dump', 'false') + def get_vif_bridge(self): return self.get_config_value('vif-bridge', 'xen-br0') @@ -263,8 +334,7 @@ return self.get_config_value('vif-script', 'vif-bridge') def get_vif_antispoof(self): - v = self.get_config_value('vif-antispoof', 'yes') - return v in ['yes', '1', 'on'] + return self.get_config_bool('vif-antispoof', 'yes') def instance(): """Get an instance of XendRoot. _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |