ia64/xen-unstable

changeset 8274:7d7973a21a3d

allow a port to be specified for migration.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Thu Dec 08 07:11:09 2005 +0000 (2005-12-08)
parents 1f6ff996a9fe
children 669b6252deee
files tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xm/migrate.py
line diff
     1.1 --- a/tools/python/xen/xend/XendClient.py	Wed Dec 07 18:59:33 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendClient.py	Thu Dec 08 07:11:09 2005 +0000
     1.3 @@ -256,12 +256,13 @@ class Xend:
     1.4                               {'op'      : 'save',
     1.5                                'file'    : filename })
     1.6  
     1.7 -    def xend_domain_migrate(self, id, dst, live=0, resource=0):
     1.8 +    def xend_domain_migrate(self, id, dst, live=0, resource=0, port=0):
     1.9          return self.xendPost(self.domainurl(id),
    1.10                               {'op'         : 'migrate',
    1.11                                'destination': dst,
    1.12                                'live'       : live,
    1.13 -                              'resource'   : resource })
    1.14 +                              'resource'   : resource,
    1.15 +                              'port'       : port })
    1.16  
    1.17      def xend_domain_pincpu(self, id, vcpu, cpumap):
    1.18          return self.xendPost(self.domainurl(id),
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Dec 07 18:59:33 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Dec 08 07:11:09 2005 +0000
     2.3 @@ -390,12 +390,13 @@ class XendDomain:
     2.4                  raise XendError(str(ex))
     2.5          return val       
     2.6  
     2.7 -    def domain_migrate(self, domid, dst, live=False, resource=0):
     2.8 +    def domain_migrate(self, domid, dst, live=False, resource=0, port=0):
     2.9          """Start domain migration."""
    2.10  
    2.11          dominfo = self.domain_lookup(domid)
    2.12  
    2.13 -        port = xroot.get_xend_relocation_port()
    2.14 +        if port == 0:
    2.15 +            port = xroot.get_xend_relocation_port()
    2.16          try:
    2.17              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    2.18              sock.connect((dst, port))
     3.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Wed Dec 07 18:59:33 2005 +0100
     3.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Thu Dec 08 07:11:09 2005 +0000
     3.3 @@ -90,7 +90,8 @@ class SrvDomain(SrvDir):
     3.4                      [['dom',         'int'],
     3.5                       ['destination', 'str'],
     3.6                       ['live',        'int'],
     3.7 -                     ['resource',    'int']])
     3.8 +                     ['resource',    'int'],
     3.9 +                     ['port',        'int']])
    3.10          return fn(req.args, {'dom': self.dom.domid})
    3.11  
    3.12      def op_pincpu(self, _, req):
     4.1 --- a/tools/python/xen/xm/migrate.py	Wed Dec 07 18:59:33 2005 +0100
     4.2 +++ b/tools/python/xen/xm/migrate.py	Thu Dec 08 07:11:09 2005 +0000
     4.3 @@ -40,6 +40,10 @@ gopts.opt('live', short='l',
     4.4            fn=set_true, default=0,
     4.5            use="Use live migration.")
     4.6  
     4.7 +gopts.opt('port', short='p',
     4.8 +          fn=set_int, default=0,
     4.9 +          use="Use specified port for migration.")
    4.10 +
    4.11  gopts.opt('resource', short='r', val='MBIT',
    4.12            fn=set_int, default=0,
    4.13            use="Set level of resource usage for migration.")
    4.14 @@ -60,5 +64,5 @@ def main(argv):
    4.15      dst = args[1]
    4.16      if dom in [DOM0_NAME, DOM0_ID]:
    4.17          opts.err('Cannot migrate ' + dom)
    4.18 -    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource)
    4.19 +    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource, opts.vals.port)
    4.20