[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] allow a port to be specified for migration.



# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 7d7973a21a3d28aaf63829259acc6558c0a7c317
# Parent  1f6ff996a9feb64f395ea3c3934cc87b80ea6db8
allow a port to be specified for migration.

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r 1f6ff996a9fe -r 7d7973a21a3d tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       Wed Dec  7 17:59:33 2005
+++ b/tools/python/xen/xend/XendClient.py       Thu Dec  8 07:11:09 2005
@@ -256,12 +256,13 @@
                              {'op'      : 'save',
                               'file'    : filename })
 
-    def xend_domain_migrate(self, id, dst, live=0, resource=0):
+    def xend_domain_migrate(self, id, dst, live=0, resource=0, port=0):
         return self.xendPost(self.domainurl(id),
                              {'op'         : 'migrate',
                               'destination': dst,
                               'live'       : live,
-                              'resource'   : resource })
+                              'resource'   : resource,
+                              'port'       : port })
 
     def xend_domain_pincpu(self, id, vcpu, cpumap):
         return self.xendPost(self.domainurl(id),
diff -r 1f6ff996a9fe -r 7d7973a21a3d tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Dec  7 17:59:33 2005
+++ b/tools/python/xen/xend/XendDomain.py       Thu Dec  8 07:11:09 2005
@@ -390,12 +390,13 @@
                 raise XendError(str(ex))
         return val       
 
-    def domain_migrate(self, domid, dst, live=False, resource=0):
+    def domain_migrate(self, domid, dst, live=False, resource=0, port=0):
         """Start domain migration."""
 
         dominfo = self.domain_lookup(domid)
 
-        port = xroot.get_xend_relocation_port()
+        if port == 0:
+            port = xroot.get_xend_relocation_port()
         try:
             sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
             sock.connect((dst, port))
diff -r 1f6ff996a9fe -r 7d7973a21a3d tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py Wed Dec  7 17:59:33 2005
+++ b/tools/python/xen/xend/server/SrvDomain.py Thu Dec  8 07:11:09 2005
@@ -90,7 +90,8 @@
                     [['dom',         'int'],
                      ['destination', 'str'],
                      ['live',        'int'],
-                     ['resource',    'int']])
+                     ['resource',    'int'],
+                     ['port',        'int']])
         return fn(req.args, {'dom': self.dom.domid})
 
     def op_pincpu(self, _, req):
diff -r 1f6ff996a9fe -r 7d7973a21a3d tools/python/xen/xm/migrate.py
--- a/tools/python/xen/xm/migrate.py    Wed Dec  7 17:59:33 2005
+++ b/tools/python/xen/xm/migrate.py    Thu Dec  8 07:11:09 2005
@@ -40,6 +40,10 @@
           fn=set_true, default=0,
           use="Use live migration.")
 
+gopts.opt('port', short='p',
+          fn=set_int, default=0,
+          use="Use specified port for migration.")
+
 gopts.opt('resource', short='r', val='MBIT',
           fn=set_int, default=0,
           use="Set level of resource usage for migration.")
@@ -60,5 +64,5 @@
     dst = args[1]
     if dom in [DOM0_NAME, DOM0_ID]:
         opts.err('Cannot migrate ' + dom)
-    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource)
+    server.xend_domain_migrate(dom, dst, opts.vals.live, opts.vals.resource, 
opts.vals.port)
         

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.