direct-io.hg

changeset 13602:ee1febe317f7

[XEND] Allow TCP XMLRPC address:port to be configured, if enabled.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Jan 25 11:58:00 2007 +0000 (2007-01-25)
parents 82c306ad212e
children 42aaf08dd20e
files tools/examples/xend-config.sxp tools/python/xen/xend/XendOptions.py tools/python/xen/xend/server/SrvServer.py
line diff
     1.1 --- a/tools/examples/xend-config.sxp	Thu Jan 25 10:34:17 2007 +0000
     1.2 +++ b/tools/examples/xend-config.sxp	Thu Jan 25 11:58:00 2007 +0000
     1.3 @@ -59,6 +59,12 @@
     1.4  
     1.5  #(xend-unix-path /var/lib/xend/xend-socket)
     1.6  
     1.7 +# Address and port xend should use for the TCP XMLRPC interface, 
     1.8 +# if xen-tcp-xmlrpc-server is set.
     1.9 +#(xen-tcp-xmlrpc-server-address 'localhost')
    1.10 +#(xen-tcp-xmlrpc-server-port 8006)
    1.11 +
    1.12 +
    1.13  # Port xend should use for the HTTP interface, if xend-http-server is set.
    1.14  #(xend-port            8000)
    1.15  
     2.1 --- a/tools/python/xen/xend/XendOptions.py	Thu Jan 25 10:34:17 2007 +0000
     2.2 +++ b/tools/python/xen/xend/XendOptions.py	Thu Jan 25 11:58:00 2007 +0000
     2.3 @@ -60,6 +60,10 @@ class XendOptions:
     2.4  
     2.5      xend_tcp_xmlrpc_server_default = 'no'
     2.6  
     2.7 +    xend_tcp_xmlrpc_server_address_default = 'localhost'
     2.8 +    
     2.9 +    xend_tcp_xmlrpc_server_port_default = 8006
    2.10 +
    2.11      xend_unix_xmlrpc_server_default = 'yes'
    2.12  
    2.13      """Default interface address xend listens at. """
    2.14 @@ -155,6 +159,14 @@ class XendOptions:
    2.15          return self.get_config_bool("xend-tcp-xmlrpc-server",
    2.16                                      self.xend_tcp_xmlrpc_server_default)
    2.17  
    2.18 +    def get_xend_tcp_xmlrpc_server_port(self):
    2.19 +        return self.get_config_int("xend-tcp-xmlrpc-server-port",
    2.20 +                                    self.xend_tcp_xmlrpc_server_port_default)
    2.21 +
    2.22 +    def get_xend_tcp_xmlrpc_server_address(self):
    2.23 +        return self.get_config_string("xend-tcp-xmlrpc-server-address",
    2.24 +                                    self.xend_tcp_xmlrpc_server_address_default)    
    2.25 +
    2.26      def get_xend_unix_xmlrpc_server(self):
    2.27          return self.get_config_bool("xend-unix-xmlrpc-server",
    2.28                                      self.xend_unix_xmlrpc_server_default)
     3.1 --- a/tools/python/xen/xend/server/SrvServer.py	Thu Jan 25 10:34:17 2007 +0000
     3.2 +++ b/tools/python/xen/xend/server/SrvServer.py	Thu Jan 25 11:58:00 2007 +0000
     3.3 @@ -204,7 +204,10 @@ def _loadConfig(servers, root, reload):
     3.4              log.error('Xen-API server configuration %s is invalid.', api_cfg)
     3.5  
     3.6      if xoptions.get_xend_tcp_xmlrpc_server():
     3.7 -        servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False, True))
     3.8 +        addr = xoptions.get_xend_tcp_xmlrpc_server_address()
     3.9 +        port = xoptions.get_xend_tcp_xmlrpc_server_port()
    3.10 +        servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False, use_tcp = True,
    3.11 +                                 host = addr, port = port))
    3.12  
    3.13      if xoptions.get_xend_unix_xmlrpc_server():
    3.14          servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))