WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] relocate.py, SrvDomain.py, XendDomain.py:

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] relocate.py, SrvDomain.py, XendDomain.py:
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 25 May 2005 17:18:43 +0000
Delivery-date: Wed, 25 May 2005 18:01:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1550.1.4, 2005/05/25 18:18:43+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        relocate.py, SrvDomain.py, XendDomain.py:
          Support vm relocation using XendCheckpoint.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 XendDomain.py       |    6 ++++++
 server/SrvDomain.py |   10 +---------
 server/relocate.py  |   14 ++++++++++++++
 3 files changed, 21 insertions(+), 9 deletions(-)


diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-25 14:02:20 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-25 14:02:20 -04:00
@@ -14,6 +14,7 @@
 
 import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
 
+from xen.xend.server import relocate
 import sxp
 import XendRoot; xroot = XendRoot.instance()
 import XendCheckpoint
@@ -510,6 +511,11 @@
         # Need a cancel too?
         # Don't forget to cancel restart for it.
         dominfo = self.domain_lookup(id)
+
+        port = xroot.get_xend_relocation_port()
+        sock = relocate.setupRelocation(dst, port)
+
+        XendCheckpoint.save(self, sock.fileno(), dominfo)
         return None
 
     def domain_save(self, id, dst, progress=False):
diff -Nru a/tools/python/xen/xend/server/SrvDomain.py 
b/tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py 2005-05-25 14:02:20 -04:00
+++ b/tools/python/xen/xend/server/SrvDomain.py 2005-05-25 14:02:20 -04:00
@@ -75,15 +75,7 @@
                      ['destination', 'str'],
                      ['live',        'int'],
                      ['resource',    'int']])
-        info = fn(req.args, {'dom': self.dom.id})
-        #req.setResponseCode(http.ACCEPTED)
-        host = info.dst_host
-        port = info.dst_port
-        dom  = info.dst_dom
-        url = "http://%s:%d/xend/domain/%d"; % (host, port, dom)
-        req.setHeader("Location", url)
-        print 'do_migrate> url=', url
-        return url
+        return fn(req.args, {'dom': self.dom.id})
 
     def op_pincpu(self, op, req):
         fn = FormFn(self.xd.domain_pincpu,
diff -Nru a/tools/python/xen/xend/server/relocate.py 
b/tools/python/xen/xend/server/relocate.py
--- a/tools/python/xen/xend/server/relocate.py  2005-05-25 14:02:20 -04:00
+++ b/tools/python/xen/xend/server/relocate.py  2005-05-25 14:02:20 -04:00
@@ -1,3 +1,5 @@
+
+import socket
 import sys
 import StringIO
 
@@ -123,3 +125,15 @@
         port = xroot.get_xend_relocation_port()
         interface = xroot.get_xend_relocation_address()
         reactor.listenTCP(port, factory, interface=interface)
+
+def setupRelocation(dst, port):
+    try:
+        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        sock.connect((dst, port))
+    except socket.error, err:
+        raise XendError("can't connect: %s" % err[1])
+
+    sock.send("receive\n")
+    print sock.recv(80)
+
+    return sock

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] relocate.py, SrvDomain.py, XendDomain.py:, BitKeeper Bot <=